home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Virushunter / BigBrother / bigbrother.asm < prev    next >
Assembly Source File  |  1996-09-26  |  56KB  |  3,138 lines

  1. ;========================================================================
  2. ;= Big Brother V3.12 by Orega Holland (c)1992                     =
  3. ;= Programmer: EA van Breemen                            =
  4. ;= Assembler : DevPac 2.14                                              =
  5. ;= All copyrights are reserved by Orega Holland.                  =
  6. ;= No part of this program may be used for other commercial programs    =
  7. ;= without the prior written permission of the author. The author       =
  8. ;= cannot be held responsible for behaviour of this program due to      =
  9. ;= the use of this program. BigBrother is SHAREWARE. This means it      =
  10. ;= can be copied for non-commercial use and it may not be copied as    =
  11. ;= a part of a commercial package.                     =
  12. ;========================================================================
  13.  
  14. ;========================================================================
  15. ;= Modifications:                                =
  16. ;= 24-1-90:   fixed ctrl-Help bug                        =
  17. ;=            added newcli                            =
  18. ;=            optimized coding                            =
  19. ;= 26-1-90:   added newcli gadget                        =
  20. ;=            modified tekstborder                        =
  21. ;=            fixed 'system has been modified' tekst bug            =
  22. ;= 27-1-90:   fixed AlertWarning                        =
  23. ;=            adjusted some windowsizes                        =
  24. ;=            intuified viewbootblocktekst                    =
  25. ;=            regulated bootio errors                        =
  26. ;=            added help                            =
  27. ;=            added preferences                            =
  28. ;= 21-10-90   fixed the memory clean message update bug                 =
  29. ;=            added script options                                      =     
  30. ;= 23-10-90   make auto detaching                        =
  31. ;= 24-10-90   fixed another clean message box bug                =
  32. ;=          added ReBoot routine                        =       
  33. ;= 25-10-90   BigBrother is now using the official reboot               =
  34. ;= 27-10-90   Fixed the endcli bug                        =
  35. ;= 01-12-90   Fixed multiple selection bug. BB replies to all           =
  36. ;=            messages first before next Wait                    =
  37. ;=            Version 2.11 Final release.                               =     
  38. ;= 16-10-91   Version 3.00                            =
  39. ;= 23-10-91   Version 3.01                            =
  40. ;=            Gadgets 2.0 look                            =
  41. ;= 24-10-91   All Arp stuff removed! (everyone may make mistakes)       =                        =
  42. ;=          Nocare patch installed.                        =
  43. ;=            Mouse accelerator    added.                        =
  44. ;=            V3.02                                =
  45. ;= 04-11-91   V3.05  Now using Signals for faster response            =
  46. ;=          Added check.task                            =
  47. ;= 05-11-91   Preferences installed                        =
  48. ;=            Function macros can be disabled (for WP etc.)            =
  49. ;=          Code optimized (pc-rel)                        =
  50. ;=            V3.07                                =
  51. ;= 07-11-91   Beta release of BigBrother. V3.09                =
  52. ;= 07-12-91   Kickstart 2.0 RomBase bug removed                =
  53. ;=          2.0 Font bug removed. V3.11                =                    =
  54. ;= 01-02-92   Fixed big_prefs update bug                =
  55. ;=          added version string                    =
  56. ;========================================================================
  57.     
  58.  
  59. XLIB    macro
  60.     xref    _LVO\1
  61.     endm
  62.  
  63.  
  64. MEMORY        equ    $1
  65. VIEW        equ    $2
  66. CLEAR        equ    $3
  67. INSTALL        equ    $4
  68. DRIVE        equ    $5
  69. WATCH        equ    $6
  70. NEWSHELL    equ    $7
  71. PREFS        equ    $8
  72. REBOOT        equ    $9
  73. NOCARE        equ    $a
  74. MOUSEACC    equ    $b
  75. FUNCTIONKEYS    equ    $c
  76. SAVE        equ    $d
  77. USE        equ    $e
  78. CANCEL        equ    $f
  79.  
  80. READ        equ    $2
  81. WRITE        equ    $3
  82.  
  83. DIE        equ    0
  84. STAY        equ    1
  85.  
  86.  
  87. IECLASS_RAWKEY        equ    $01
  88. IECLASS_RAWMOUSE    equ    $02
  89. ie_X            equ    $A
  90. ie_Y            equ    $C
  91. IEQUALIFIER_CONTROL     equ    $08
  92.  
  93. HELP_KEY        equ    $5f
  94. FUNC_F1            equ    $50
  95. FUNC_F2            equ    $51
  96. FUNC_F3            equ    $52
  97. FUNC_F4            equ    $53
  98. FUNC_F5            equ    $54
  99. FUNC_F6            equ    $55
  100. FUNC_F7            equ    $56
  101. FUNC_F8            equ    $57
  102. FUNC_F9            equ    $58
  103. FUNC_F10        equ    $59
  104.  
  105.  
  106.  
  107. IND_ADDHANDLER        equ    $09
  108. IND_REMHANDLER        equ    $a
  109. NT_MESSAGE        equ    $05
  110. NT_MSGPORT        equ    $04
  111. NT_TASK            equ    $01
  112. PA_SIGNAL        equ    $00
  113. TC_SIZE            equ    $5C
  114. TC_SPLOWER        equ    $3A
  115. TC_SPREG        equ    $36
  116. TC_SPUPPER        equ    $3E
  117. MEMF_CHIP        equ    $2
  118. MEMF_CLEAR        equ    $10000
  119. MEMF_PUBLIC        equ    $1
  120. io_Message        equ    $00
  121. io_Data            equ    $28
  122. io_Command        equ    $1c
  123. Ln_Type            equ    $08
  124. Ln_Name            equ    $0a
  125. Ln_Pri            equ    $09
  126. mp_Size            equ    $22
  127. mp_Node            equ    $00
  128. mp_SigBit        equ    $0f
  129. mp_Flags        equ    $0e
  130. mp_SigTask        equ    $10
  131. mn_Node            equ    $00
  132. mn_Length        equ    $12
  133. mn_ReplyPort        equ    $0e
  134.  
  135. gg_GadgetID        equ    $26
  136.  
  137. im_Class        equ    $14
  138. im_Code            equ    $18
  139. im_Address        equ    $1c
  140.  
  141. GadgetID        equ    $26
  142.  
  143. wd_UserPort        equ    $56
  144. wd_RPort        equ    $32
  145.  
  146. WindowPtr        equ    $b8
  147.  
  148. nw_Flags        equ    $0e
  149. nw_Type            equ    $2e
  150.  
  151. is_Code            equ    $12
  152. is_Data            equ    $0e
  153. is_Node            equ    $00
  154.  
  155. GADGETUP        equ    $40
  156. GADGHNONE        equ    $03
  157. GADGHIMAGE        equ    $02
  158. GADGHCOMP        equ    0
  159. SELECTED        equ    $80
  160. CLOSEWINDOW        equ    $200
  161. RAWKEY            equ    $400
  162. WINDOWDRAG        equ    $02
  163. WINDOWDEPTH        equ    $04
  164. WINDOWCLOSE        equ    $08
  165. ACTIVATE        equ    $1000
  166. NOCAREREFRESH        equ    $20000
  167. RELVERIFY        equ    $01
  168. BOOLGADGET        equ    $01
  169. TOGGLESELECT        equ    $100
  170. RP_JAM1            equ    $00
  171. RP_JAM2            equ    $01
  172. TOPAZ_EIGHTY        equ    $8
  173.  
  174. TD_CHANGESTATE        equ    14
  175.  
  176. NULL            equ    $00
  177.  
  178. NOCARE_PATCH        equ    $01
  179. MOUSE_PATCH        equ    $02
  180. FUNCTION_PATCH        equ    $04
  181. REFRESHBIT0        equ    $06
  182. WBENCHSCREEN        equ    $01
  183.     
  184. ROM_BASE    equ    $f80000        ; Start of Kickstart 2.0
  185.  
  186. MAGIC_ROMEND        EQU $01000000   ;End of Kickstart ROM
  187. MAGIC_SIZEOFFSET    EQU -$14        ;Offset from end of ROM to Kickstart size
  188. V36_EXEC        EQU 36        ;Exec with the ColdReboot() function
  189. TEMP_ColdReboot     EQU -726        ;Offset of the V36 ColdReboot function
  190. LIB_VERSION    EQU    $14
  191.  
  192.  
  193.     XLIB    OpenLibrary
  194.     XLIB    CloseLibrary
  195.     XLIB    OpenDevice
  196.     XLIB    CloseDevice
  197.     XLIB    OpenWindow
  198.     XLIB    CloseWindow
  199.     XLIB    CreateProc
  200.     XLIB    UnLoadSeg
  201.     XLIB    AddTask
  202.     XLIB    Permit
  203.     XLIB    Forbid
  204.     XLIB    DoIO
  205.     XLIB    Delay
  206.     XLIB    GetMsg
  207.     XLIB    ReplyMsg
  208.     XLIB    AllocSignal
  209.     XLIB    FreeSignal
  210.     XLIB    Signal
  211.     XLIB    FindTask
  212.     XLIB    AddPort
  213.     XLIB    RemPort
  214.     XLIB    FindName
  215.     XLIB    DeviceProc
  216.     XLIB    RefreshGadgets
  217.     XLIB    Wait
  218.     XLIB    Move
  219.     XLIB    Text
  220.     XLIB    SetAPen
  221.     XLIB    AllocMem
  222.     XLIB    FreeMem
  223.     XLIB    SetWindowTitles
  224.     XLIB    FindResident
  225.     XLIB    RemTask
  226.     XLIB    DisplayBeep
  227.     XLIB    Disable
  228.     XLIB    Enable
  229.     XLIB    DrawBorder
  230.     XLIB    PrintIText
  231.     XLIB    WBenchToFront
  232.     XLIB    DisplayAlert
  233.     XLIB    SizeWindow
  234.     XLIB    WaitPort
  235.     XLIB    Open
  236.     XLIB    Close
  237.     XLIB    Read
  238.     XLIB    Lock
  239.     XLIB    UnLock
  240.     XLIB    Execute
  241.     XLIB    WaitPort
  242.     XLIB    Supervisor    
  243.     XLIB    Write
  244.     XLIB    Output
  245.     XLIB    SetFunction
  246.  
  247. STACK_SIZE    equ    4096
  248.  
  249.  
  250.  
  251. ;===================================
  252. ;= Startup code for auto detaching =
  253. ;= BigBrother V2.11                =
  254. ;===================================
  255.  
  256.     
  257.     section    "Startup",code
  258.  
  259.  
  260. start    bra.s    1$
  261.     dc.b    '$VER: BigBrother V3.12 (1-2-1992)',$a,$d,0
  262.     even
  263. 1$    move.l    ($4).L,a6
  264.     sub.l    a1,a1
  265.     jsr    _LVOFindTask(a6)
  266.     move.l    d0,a4
  267.     tst.l    $ac(a4)            ; Are we from the WBench ????
  268.     bne.s    from_cli
  269.     lea.l    $5c(a4),a0
  270.     jsr    _LVOWaitPort(a6)
  271.     jsr    _LVOGetMsg(a6)        ; Get message
  272. from_cli:
  273.     move.l    ($4).L,a6
  274.     lea.l    DosName,a1
  275.     clr.l    d0
  276.     jsr    _LVOOpenLibrary(a6)
  277.     move.l    d0,a5
  278.     beq    uit
  279.     move.l    #BIG_NAME,a1
  280.     jsr    _LVOFindTask(a6)
  281.     tst.l    d0
  282.     bne    already_active
  283.     move.l    a5,a6
  284.     jsr    _LVOOutput(a6)
  285.     move.l    d0,d1
  286.     move.l    #Title,d2
  287.     move.l    #Title_Size,d3
  288.     jsr    _LVOWrite(a6)
  289.     move.l    #NIL_NAME,d1
  290.     move.l    #1006,d2
  291.     jsr    _LVOOpen(a6)
  292.     move.l    d0,pcb_Input
  293.     move.l    d0,pcb_Output
  294.  
  295.     move.l    #mymain,d3
  296.     sub.l    #4,d3
  297.     lsr.l    #2,d3            ; make BPTR !!!!!!
  298.         move.l  #BIG_NAME,d1
  299.         move.l  #2,d2            ; pri 2
  300.         move.l  #4096,d4
  301.         jsr    _LVOCreateProc(a5)
  302.  
  303.     lea.l    start(pc),a0
  304.     move.l    #0,-4(a0)        ; Erase pointer to next segment
  305.     bra.s    cc1    
  306.  
  307. already_active:
  308.     move.l    a5,a6
  309.     jsr    _LVOOutput(a6)
  310.     move.l    d0,d1
  311.     move.l    #Active_Title,d2
  312.     move.l    #Active_Size,d3
  313.     jsr    _LVOWrite(a6)
  314.     
  315. cc1    move.l    a5,a1
  316.     move.l    ($4).L,a6
  317.     jsr    _LVOCloseLibrary(a6)
  318. uit    rts
  319.  
  320.  
  321. ;======================================
  322. ;= The Message Create Port function   =
  323. ;= a0 contains pointer to name        =
  324. ;= d0 contains priority               =
  325. ;= on exit:                           =
  326. ;= d0 contains pointer to messageport =
  327. ;= or 0 if failed                     =
  328. ;= All registers are affected         =
  329. ;======================================
  330.  
  331.  
  332. CreatePort:
  333.     move.l    a0,a5
  334.     move.l    d0,d6
  335.     bsr.s    GetSignal
  336.     cmp.l    #-1,d0
  337.     bne.s    cr_1
  338. create_out:
  339.     moveq    #0,d0
  340.     rts
  341. cr_1    move.l    d0,d4
  342.     move.l    #mp_Size,d0
  343.     move.l    #MEMF_CLEAR|MEMF_PUBLIC,d1
  344.     jsr    _LVOAllocMem(a6)
  345.     move.l    d0,d5
  346.     bne.s    2$
  347.     move.l    d4,d0
  348.     jsr    _LVOFreeSignal(a6)
  349.     bra.s    create_out
  350. 2$    move.l    d5,a0
  351.     move.b    d4,mp_SigBit(a0)
  352.     move.b    d6,mp_Node+Ln_Pri(a0)
  353.     move.b    #NT_MSGPORT,mp_Node+Ln_Type(a0)
  354.     move.l    a5,mp_Node+Ln_Name(a0)
  355.     move.b    #PA_SIGNAL,mp_Flags(a0)
  356.     sub.l    a1,a1
  357.     jsr    _LVOFindTask(a6)
  358.     move.l  d0,mp_SigTask(a0)
  359.     move.l    a0,a1
  360.     jsr    _LVOAddPort(a6)
  361.     move.l    d5,d0
  362.     rts
  363.  
  364.  
  365. ;=================================
  366. ;= Get a signal for current task =
  367. ;= Assumes it will succeed.      =
  368. ;= mask will be in d1            =
  369. ;=================================
  370.  
  371. GetSignal:
  372.     move.l    $4,a6
  373.     moveq    #-1,d0        
  374.     jsr    _LVOAllocSignal(a6)
  375.     moveq    #1,d1
  376.     lsl.l    d0,d1
  377.     rts
  378.  
  379.  
  380. ;========================================
  381. ;= Section containing the resident code =
  382. ;========================================
  383.  
  384.     Section "Main",code
  385.  
  386. ;=======================================
  387. ;= Initialisation code for Big Brother =
  388. ;=======================================
  389. mymain    move.l    ($4).L,a6
  390.     lea.l    DosName(pc),a1
  391.     clr.l    d0
  392.     jsr    _LVOOpenLibrary(a6)
  393.     move.l    d0,DOSBase
  394.     beq    nodos
  395.     bsr    loadprefs
  396.     move.l    ($4).L,a6
  397.     clr.l    d0
  398.     lea.l    IntuitionName(pc),a1
  399.     jsr    _LVOOpenLibrary(a6)
  400.     move.l    d0,IntuitionBase
  401.     beq    nointuition
  402.     clr.l    d0
  403.     lea.l    GraphicsName(pc),a1
  404.     jsr    _LVOOpenLibrary(a6)
  405.     move.l    d0,GfxBase
  406.     beq    nographics
  407.  
  408.     bsr    initall            ; Open inputdevice etc.
  409.     bra    check            ; Jump to checkroutine
  410.     
  411.  
  412. ;==================================
  413. ;= loadprefs: tries to load prefs =
  414. ;==================================
  415. loadprefs:
  416.     move.l    DOSBase(pc),a6
  417.     move.l    #prefs_file,d1
  418.     move.l    #-2,d2
  419.     jsr    _LVOLock(a6)
  420.     move.l    d0,lock
  421.     beq    no_prefs
  422.     move.l    #prefs_file,d1
  423.     move.l    #1005,d2
  424.     jsr    _LVOOpen(a6)
  425.     move.l    d0,filehandle
  426.     move.l    d0,d1
  427.     move.l    #DoIOVector,d2
  428.     moveq    #9,d3
  429.     jsr    _LVORead(a6)
  430.     move.l    d0,d5
  431.     move.l    filehandle,d1
  432.     jsr    _LVOClose(a6)
  433.     move.l    lock,d1
  434.     jsr    _LVOUnLock(a6)
  435.     cmp.l    #9,d5
  436.     bne.s    no_prefs    ; Read Error has occured !
  437.     bsr    reflect        ; Update gadget flags
  438.     rts
  439. no_prefs:
  440.     bsr    Saddam
  441.     move.b    #MOUSE_PATCH|FUNCTION_PATCH|NOCARE_PATCH,patchstatus
  442. save_prefs:
  443.     move.l    DOSBase(pc),a6
  444.     move.l    #prefs_file,d1
  445.     move.l    #1006,d2
  446.     jsr    _LVOOpen(a6)
  447.     move.l    d0,filehandle
  448.     move.l    d0,d1
  449.     move.l    #DoIOVector,d2
  450.     moveq    #9,d3
  451.     jsr    _LVOWrite(a6)
  452.     move.l    filehandle,d1
  453.     jsr    _LVOClose(a6)
  454.     rts
  455.     
  456.  
  457. ;=============================================
  458. ;= Routine to install a input device handler =
  459. ;=============================================
  460.  
  461.  
  462. initall:                    ; Open inputdevice
  463.     move.b    #0,signal
  464.     move.l    #0,oldopenwindow
  465.     move.b    #0,drive            ; df0: is default
  466.     move.b    #STAY,status
  467.     bsr    nocare                ; install nocare patch
  468.  
  469.  
  470.     lea.l    MyPortName(pc),a0
  471.     moveq    #0,d0
  472.     jsr    CreatePort
  473.     move.l    d0,InputDevPort
  474.  
  475.     sub.l    a1,a1
  476.     jsr    _LVOFindTask(a6)
  477.     move.l    d0,a3
  478.     move.l    d0,bigtask        ; Store big task
  479.     move.l    #-1,WindowPtr(a3)    ; I don't want requesters
  480.  
  481.     lea.l    InputRequestBlock(pc),a0
  482.     move.b    #NT_MESSAGE,io_Message+mn_Node+Ln_Type(a0)
  483.     move.w    #$30,io_Message+mn_Length(a0)
  484.     move.l    InputDevPort(pc),io_Message+mn_ReplyPort(a0)
  485.  
  486.     lea.l    HandlerStuff(pc),a1
  487.     move.l    #myhandler,is_Code(a1)
  488.     move.b    #127,is_Node+Ln_Pri(a1)
  489.     move.l    #0,is_Data(a1)
  490.     
  491.     lea.l    InputRequestBlock(pc),a1
  492.     lea.l    InputDeviceName(pc),a0
  493.     clr.l    d0
  494.     clr.l    d1
  495.     jsr    _LVOOpenDevice(a6)
  496.  
  497.     lea.l    InputRequestBlock(pc),a0
  498.     move.w    #IND_ADDHANDLER,io_Command(a0)
  499.     move.l    #HandlerStuff,io_Data(a0)
  500.     move.l    a0,a1
  501.     jsr    _LVODoIO(a6)        ; Install handler
  502.  
  503.     jsr    GetSignal        ; Allocate Signal for activation
  504.     move.l    d1,virusmask
  505.  
  506.     jsr    GetSignal        ; Allocate Signal for activation
  507.     move.l    d1,keymask
  508.     
  509.     move.l    #TC_SIZE,d0
  510.     move.l    #MEMF_CLEAR|MEMF_PUBLIC,d1
  511.     jsr    _LVOAllocMem(a6)
  512.     move.l    d0,checktask
  513.     
  514.     move.l    d0,a0
  515.     lea.l    stack(pc),a1
  516.     move.l    a1,TC_SPLOWER(a0)
  517.     move.l    a1,d1
  518.     add.l    #1024,d1
  519.     move.l    d1,TC_SPUPPER(a0)
  520.     move.l    d1,TC_SPREG(a0)
  521.     move.b    #NT_TASK,Ln_Type(a0)
  522.     move.b    #-1,Ln_Pri(a0)
  523.     move.l    #CHECK_NAME,Ln_Name(a0)
  524.  
  525.     move.l    a0,a1
  526.     move.l    #NewCheck,a2
  527.     move.l    #0,a3
  528.     jsr    _LVOAddTask(a6)
  529.  
  530.     rts
  531.     
  532. ;================================
  533. ;= Code for Nocare window patch =
  534. ;================================
  535.  
  536. nocare:
  537.     move.l    oldopenwindow,d0
  538.     bne    1$            ; Patch already installed
  539.     move.l    ($4).L,a6
  540.     move.l    IntuitionBase(pc),a1
  541.     move.w    #_LVOOpenWindow,a0
  542.     lea.l    newopenwindow(pc),a2
  543.     move.l    a2,d0
  544.     jsr    _LVOSetFunction(a6)
  545.     move.l    d0,oldopenwindow
  546. 1$    rts
  547.  
  548. nocare_off:                ; Disable
  549.     move.l    ($4).L,a6
  550.     move.l    IntuitionBase(pc),a1
  551.     move.w    #_LVOOpenWindow,a0
  552.     move.l    oldopenwindow,d0
  553.     beq    1$            ; not yet installed
  554.     jsr    _LVOSetFunction(a6)
  555.     move.l    #0,oldopenwindow
  556. 1$    rts
  557.  
  558. ;=======================
  559. ;= Actual Nocare patch =
  560. ;=======================
  561. newopenwindow:
  562.     cmp.w    #WBENCHSCREEN,nw_Type(a0)
  563.     bne.s    dontchange
  564.     move.l    nw_Flags(a0),d0
  565.     bclr    #REFRESHBIT0,d0
  566.     move.l    d0,nw_Flags(a0)
  567. dontchange:
  568.     move.l    oldopenwindow(pc),a1
  569.     jmp    (a1)            ; Jump to original code.
  570.  
  571.  
  572.  
  573. ;=======================
  574. ;= Code for Check Task =
  575. ;=======================
  576.  
  577. NewCheck:
  578.     bsr.s    chlus            ; Check routine
  579.     cmp.b    #DIE,status
  580.     beq.s    killme
  581.     bra.s    NewCheck
  582. killme    move.l    #0,a1
  583.     move.l    $4,a6
  584.     jsr    _LVORemTask(a6)
  585.     rts                ; Should never get here...
  586.  
  587.  
  588. chlus    move.l    ($4).L,a0
  589.     move.l    a0,a6
  590.     clr.l    d2
  591.     tst.l    42(a0)
  592.     beq.s    1$
  593.     ori.l    #1,d2
  594. 1$    tst.l    46(a0)
  595.     beq.s    2$
  596.     ori.l    #1,d2
  597. 2$    tst.l    546(a0)
  598.     beq.s    3$
  599.     ori.l    #2,d2
  600. 3$    tst.l    550(a0)
  601.     beq.s    4$
  602.     ori.l    #2,d2
  603. 4$    lea.l    350(a0),a0
  604.     lea.l    devicename(pc),a1
  605.     move.l    ($4).L,a6    
  606.      jsr    _LVOFindName(a6)
  607.     move.l    d0,a0
  608.     move.l    -28(a0),d1
  609.     cmp.l    #ROM_BASE,d1
  610.     bhs.s    5$
  611.     ori.l    #8,d2
  612. 5$    move.l    ($4).L,a0
  613.     move.l    -454(a0),d1
  614.     cmp.l    DoIOVector,d1
  615.     beq.s    6$
  616.     ori.l    #4,d2
  617. 6$    lea.l    TaskName(pc),a1
  618.     jsr    _LVOFindTask(a6)
  619.     tst.l    d0
  620.     beq.s    7$
  621.     ori.l    #16,d2
  622. 7$    andi.l    #31,d2
  623.     move.l    d2,memorymask
  624.     moveq    #0,d0
  625.     lea.l    expert(pc),a0
  626.     move.b    0(a0,d2),d0
  627.     cmp.b    #0,d0
  628.     beq.s    novirus
  629.     cmp.b    #2,d0
  630.     beq.s    novirus
  631.     move.b    d0,signal
  632.     move.l    ($4).L,a6
  633.     move.l    virusmask,d0
  634.     move.l    bigtask,a1
  635.     jsr    _LVOSignal(a6)    ; Signal Big Brother
  636. novirus
  637.     rts
  638.     
  639.         
  640. ;======================================================
  641. ;= The Input Device Handler for checking the Help Key =
  642. ;======================================================
  643.  
  644. myhandler            ; The input_handler
  645.     cmp.b    #IECLASS_RAWMOUSE,4(a0)
  646.     bsr    mouseacc
  647.     cmp.b    #IECLASS_RAWKEY,4(a0)
  648.     beq.s    akey
  649. noop    move.l    a0,d0        ; Return head of list
  650.     rts
  651. akey    move.w    8(a0),d0
  652.     and.w    #IEQUALIFIER_CONTROL,d0        ; Mask Control bit
  653.     beq.s    noop                ; None of my keys
  654.     cmp.w    #HELP_KEY,6(a0)
  655.     bne.s    1$        ; Check next key
  656.     move.w    #HELP_KEY,keyfound
  657.     bra    needed
  658. 1$    btst    #2,patchstatus(pc)
  659.     beq.s    noop            ; Function keys are disabled
  660.     cmp.w    #FUNC_F1,6(a0)
  661.     bne.s    2$
  662.     move.w    #FUNC_F1,keyfound
  663.     bra    needed
  664. 2$    cmp.w    #FUNC_F2,6(a0)
  665.     bne.s    3$
  666.     move.w    #FUNC_F2,keyfound
  667.     bra    needed
  668. 3$    cmp.w    #FUNC_F3,6(a0)
  669.     bne.s    4$
  670.     move.w    #FUNC_F3,keyfound
  671.     bra    needed
  672. 4$    cmp.w    #FUNC_F4,6(a0)
  673.     bne.s    5$
  674.     move.w    #FUNC_F4,keyfound
  675.     bra    needed
  676. 5$    cmp.w    #FUNC_F5,6(a0)
  677.     bne.s    6$
  678.     move.w    #FUNC_F5,keyfound
  679.     bra    needed
  680. 6$    cmp.w    #FUNC_F6,6(a0)
  681.     bne.s    7$
  682.     move.w    #FUNC_F6,keyfound
  683.     bra    needed
  684. 7$    cmp.w    #FUNC_F7,6(a0)
  685.     bne.s    8$
  686.     move.w    #FUNC_F7,keyfound
  687.     bra    needed
  688. 8$    cmp.w    #FUNC_F8,6(a0)
  689.     bne.s    9$
  690.     move.w    #FUNC_F8,keyfound
  691.     bra    needed
  692. 9$    cmp.w    #FUNC_F9,6(a0)
  693.     bne.s    10$
  694.     move.w    #FUNC_F9,keyfound
  695.     bra    needed
  696. 10$    cmp.w    #FUNC_F10,6(a0)
  697.     bne    noop
  698.     move.w    #FUNC_F10,keyfound
  699. needed    movem.l    d0-d6/a0-a6,-(sp)
  700.     move.l    ($4).L,a6
  701.     move.l    keymask,d0
  702.     move.l    bigtask,a1
  703.     jsr    _LVOSignal(a6)    ; Signal Big Brother
  704.     movem.l    (sp)+,d0-d6/a0-a6
  705.     move.l    (a0),a0
  706.     cmp.l    #0,a0
  707.     beq.s    out
  708.     bra    myhandler    ; Process more events !
  709. out    clr.l    d0        ; End of chain
  710.     rts
  711.  
  712. ;==============================
  713. ;= A simple mouse accelerator =
  714. ;==============================
  715.  
  716. mouseacc:
  717.     btst.b    #1,patchstatus(pc)
  718.     bne.s    3$
  719.     rts
  720. 3$    cmp.w    #1,acc
  721.     bne.s    1$
  722.     rts
  723. 1$    movem.l    d2-d6,-(a7)    
  724.     move.w    acc,d3
  725.     move.w    #1,d2
  726.     move.w    ie_X(a0),d1
  727.     bpl.s    2$
  728.     neg.w    d1
  729.     move.w    #-1,d2
  730. 2$    cmp.w    #0,d1
  731.     bls    sk1
  732.     sub.w    #1,d1
  733.     mulu.w    d3,d1
  734.     add.w    #1,d1
  735.     mulu.w    d2,d1
  736.     move.w    d1,ie_X(a0)
  737.  
  738. sk1    move.w    #1,d2
  739.     move.w    ie_Y(a0),d1
  740.     bpl.s    3$
  741.     neg.w    d1
  742.     move.w    #-1,d2
  743. 3$    cmp.w    #0,d1
  744.     bls    sk2
  745.     sub.w    #1,d1
  746.     mulu.w    d3,d1
  747.     add.w    #1,d1
  748.     mulu.w    d2,d1
  749.     move.w    d1,ie_Y(a0)
  750. sk2    movem.l (a7)+,d2-d6
  751.     rts
  752.  
  753.  
  754.  
  755. ;====================================
  756. ;=    Code for checking the Amiga   =
  757. ;====================================
  758.  
  759. check    move.l    ($4).L,a6
  760.     move.l    virusmask,d0
  761.     or.l    keymask,d0
  762.     jsr    _LVOWait(a6)        ; Wait for signal
  763.     move.l    d0,d1
  764.     and.l    virusmask,d0
  765.     beq.s    no_virus_signal
  766.     clr.l    d0        ; must be a virus
  767.     move.b    signal,d0
  768.     beq.s    check
  769.     cmp.b    #2,d0
  770.     beq.s    check
  771.     bra.s    activate    ; Open window etc., a virus !!!
  772. no_virus_signal:
  773.     move.w    keyfound(pc),d0
  774.     cmp.w    #FUNC_F1,d0
  775.     bne.s    1$
  776.     bsr    newcli
  777. 1$    cmp.w    #HELP_KEY,d0
  778.     beq.s    activate
  779.     bsr    do_function_keys
  780.     bra.s    check
  781.  
  782. ;=========================================================
  783. ;= Routine for the window processing in case of an event =
  784. ;=========================================================
  785.  
  786. activate
  787.     move.l    IntuitionBase(pc),a6
  788.     jsr    _LVOWBenchToFront(a6)
  789.     move.l    #NewWindowStructure1,a0
  790.     jsr    _LVOOpenWindow(a6)
  791.     move.l    d0,window
  792.     move.l    d0,a0
  793.     move.l    wd_RPort(a0),rp
  794.     move.l    rp,a0
  795.     move.l    #Border2,a1
  796.     moveq    #0,d0
  797.     moveq    #0,d1
  798.     jsr    _LVODrawBorder(a6)    
  799.     bsr    printstatus
  800. waitloop:
  801.     move.l    window(pc),a0
  802.     move.l    wd_UserPort(a0),a0
  803.     move.l    a0,userport
  804.     moveq    #0,d1
  805.     move.b    mp_SigBit(a0),d1
  806.     moveq    #1,d0
  807.     asl.l    d1,d0
  808.     move.l    ($4).L,a6
  809.     jsr    _LVOWait(a6)    ; Wait for an event
  810. look    move.l    ($4).L,a6
  811.     move.l    userport,a0    ; Get UserPort
  812.     jsr    _LVOGetMsg(a6)    ; Get Message from IDCMP Port
  813.     tst.l    d0
  814.     beq    waitloop    ; No more messages left
  815.     move.l    d0,a1
  816.     move.l    im_Class(a1),d4
  817.     move.w    im_Code(a1),d5
  818.     move.l    im_Address(a1),a2
  819.     jsr    _LVOReplyMsg(a6) ; Reply the message
  820.  
  821.     cmp.l    #RAWKEY,d4
  822.     bne.s    1$
  823.     cmp.w    #HELP_KEY,d5
  824.     bne.s    1$
  825.     bsr    showhelp
  826.     bra    look
  827. 1$    cmp.l    #CLOSEWINDOW,d4
  828.     beq.s    closealldown
  829.     cmp.l    #GADGETUP,d4
  830.     bne.s    look
  831.  
  832.     bsr.s    process_gadgets    ; Someone has pressed a gadget
  833.     cmp.w    #WATCH,d0
  834.     bne.s    look
  835.  
  836. watchmode:
  837.     move.l    IntuitionBase(pc),a6
  838.     move.l    window(pc),a0
  839.     jsr    _LVOCloseWindow(a6)
  840.     move.b    #0,signal
  841.     bra    check
  842.  
  843. closealldown:
  844.     bsr    yesno3                ; Want to quit???
  845.     tst.l    d0
  846.     beq    look                ; no way
  847.     move.l    IntuitionBase(pc),a6
  848.     move.l    window(pc),a0
  849.     jsr    _LVOCloseWindow(a6)
  850.     move.b    #0,signal
  851.     jmp    exit
  852.  
  853. Saddam    move.l    ($4).L,a6
  854.     move.l    -454(a6),DoIOVector
  855.     lea.l    350(a6),a0
  856.     lea.l    devicename(pc),a1
  857.     move.l    ($4).L,a6    
  858.      jsr    _LVOFindName(a6)
  859.     move.l    d0,a0
  860.     move.l    -28(a0),TrackDiskIO
  861.     rts
  862.  
  863.     
  864.  
  865. ;==================================
  866. ;= Routine for processing Gadgets =
  867. ;==================================
  868.  
  869. process_gadgets:
  870.     move.w    gg_GadgetID(a2),d0
  871.     cmp.w    #WATCH,d0
  872.     bne.s    1$
  873.     rts
  874. 1$    cmp.w    #DRIVE,d0
  875.     beq.s    nextdrive
  876.     cmp.w    #CLEAR,d0
  877.     beq    clearmemory
  878.     cmp.w    #VIEW,d0
  879.     beq    viewbootblock
  880.     cmp.w    #INSTALL,d0
  881.     beq    installdisk
  882.     cmp.w    #MEMORY,d0
  883.     beq    viewmemory
  884.     cmp.w    #NEWSHELL,d0
  885.     beq    newcli
  886.     cmp.w    #PREFS,d0
  887.     beq    preferences
  888.     cmp.w    #REBOOT,d0
  889.     beq    reboot
  890.     clr.l    d0        ; Clear d0 if GadgetID <> WATCH
  891.     rts
  892.  
  893. ;==============================
  894. ;= Finds next available drive =
  895. ;==============================
  896.  
  897. nextdrive:
  898.     move.b    drive,d0
  899.     addq    #1,d0
  900.     cmp.b    #4,d0        ; drive number too high ???
  901.     bne.s    1$
  902.     moveq    #0,d0        ; just select df0:
  903. 1$    cmp.b    #0,d0
  904.     bne.s    2$
  905.     move.l    df0,ITextText1
  906. 2$    cmp.b    #1,d0
  907.     bne.s    3$
  908.     move.l    df1,ITextText1
  909. 3$    cmp.b    #2,d0
  910.     bne.s    4$
  911.     move.l    df2,ITextText1
  912. 4$    cmp.b    #3,d0
  913.     bne.s    5$
  914.     move.l    df3,ITextText1
  915. 5$    move.b    d0,drive
  916.     move.l    #ITextText1,d1
  917.     move.l    DOSBase(pc),a6
  918.     jsr    _LVODeviceProc(a6)    ; Does drive exists ?
  919.     tst.l    d0
  920.     bne.s    6$        ; Yeah
  921.     bra.s    nextdrive    ; Try next drive
  922. 6$    move.l    #Gadget1,a0
  923.     move.l    window(pc),a1
  924.     move.l    #0,a2
  925.     move.l    IntuitionBase(pc),a6
  926.     jsr    _LVORefreshGadgets(a6)
  927.     clr.l    d0
  928.     rts
  929.  
  930. ;================================
  931. ;= Clears memory area from viri =
  932. ;================================
  933.  
  934. clearmemory:
  935.     bsr    yesno            ; Are you sure????
  936.     tst.l    d0
  937.     beq    clearexit        ; Noop
  938.     move.l    ($4).L,a6
  939.     jsr    _LVODisable(a6)
  940.     lea.l    TaskName(pc),a1
  941.     jsr    _LVOFindTask(a6)
  942.     tst.l    d0
  943.     beq.s    1$            ; No rad
  944.     move.l    d0,a1
  945.     jsr    _LVORemTask(a6)        ; Kill it!!!
  946. 1$    move.l    ($4).L,a6
  947.     clr.l    42(a6)
  948.     clr.l    46(a6)
  949.     clr.l    546(a6)
  950.     clr.l    550(a6)
  951.     clr.l    554(a6)
  952.     cmp.l    #0,TrackDiskIO
  953.     beq    2$
  954.     lea.l    350(a6),a0
  955.     lea.l    devicename(pc),a1
  956.     move.l    ($4).L,a6    
  957.      jsr    _LVOFindName(a6)
  958.     move.l    d0,a0
  959.     move.l    TrackDiskIO(pc),-28(a0)    ; Restore TrackDiskIO
  960. 2$    move.l    DoIOVector(pc),-454(a6)
  961.     clr.l    d1
  962.     lea.l    34(a6),a0
  963.     move.w    #$16,d0
  964. loop    add.w    (a0)+,d1
  965.     dbf    d0,loop
  966.     not.w    d1
  967.     move.w    d1,82(a6)
  968.     jsr    _LVOEnable(a6)
  969.     move.l    IntuitionBase(pc),a6
  970.     move.l    #0,a0
  971.     jsr    _LVODisplayBeep(a6)
  972.     move.l    ($4).L,a6
  973.     move.b    #0,signal
  974.     bsr    chlus            ; Check memory
  975.     bsr    printstatus        ; Show current memory status
  976. clearexit:
  977.     clr.l     d0            ; No WATCH Gadget
  978.     rts
  979.  
  980. ;====================================
  981. ;= Are you sure to clear memory???? =
  982. ;====================================
  983.  
  984. yesno:
  985.     move.l    IntuitionBase(pc),a6
  986.     moveq    #0,d0
  987.     lea.l    Alertstring(pc),a0
  988.     move.l    #50,d1
  989.     jsr    _LVODisplayAlert(a6)
  990.     rts
  991.  
  992. ;====================================
  993. ;= Are you sure to reboot????       =
  994. ;====================================
  995.  
  996. yesno2:
  997.     move.l    IntuitionBase(pc),a6
  998.     moveq    #0,d0
  999.     lea.l    Alertstring2(pc),a0
  1000.     move.l    #50,d1
  1001.     jsr    _LVODisplayAlert(a6)
  1002.     rts
  1003.  
  1004. ;====================================
  1005. ;= Are you sure you want to quit??? =
  1006. ;====================================
  1007.  
  1008. yesno3:
  1009.     move.l    IntuitionBase(pc),a6
  1010.     moveq    #0,d0
  1011.     lea.l    Alertstring3(pc),a0
  1012.     move.l    #50,d1
  1013.     jsr    _LVODisplayAlert(a6)
  1014.     rts
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020. ;==================================================
  1021. ;= Routine shows a bootblock in ascii in a window =
  1022. ;==================================================
  1023.  
  1024. viewbootblock:
  1025.     move.w    #534,hsize        ; Adjust windowwidth
  1026.     move.w    #150,hsize+2        ; Adjust height
  1027.     lea.l    InitTitle(pc),a0
  1028.     move.l    a0,title2
  1029.     move.l    IntuitionBase(pc),a6
  1030.     lea.l    NewWindowStructure2(pc),a0
  1031.     jsr    _LVOOpenWindow(a6)
  1032.     move.l    d0,window2
  1033.     move.l    d0,a0
  1034.     move.l    wd_RPort(a0),rp2
  1035.  
  1036.     move.l    ($4).L,a6
  1037.     move.l    #1024,d0
  1038.     moveq    #2,d1            ; Chip memory needed
  1039.     jsr    _LVOAllocMem(a6)    ; Allocate buffer for bootblock
  1040.     move.l    d0,buffer
  1041.     
  1042.     bsr    readbootblock
  1043.     move.b    io_error,d0
  1044.     cmp.b    #29,d0
  1045.     bne    1$            ; Disk is available
  1046.  
  1047.     move.l    window2(pc),a0
  1048.     move.l    #-234,d0
  1049.     move.l    #-100,d1
  1050.     move.l    IntuitionBase(pc),a6
  1051.     jsr    _LVOSizeWindow(a6)    ; Make window smaller
  1052.     move.l    #disk_changed,Mt5
  1053.     move.l    #disk_changed,Mt6
  1054.     move.l    rp2,a0
  1055.     clr.l    d0
  1056.     clr.l    d1
  1057.     lea.l    MyTekst5(pc),a1
  1058.     jsr    _LVOPrintIText(a6)    ; No disk !
  1059.     bra    2$            ; skip printbuffer
  1060.  
  1061.  
  1062. 1$    bsr    printbuffer
  1063.  
  1064. 2$    move.l    buffer(pc),a1
  1065.     move.l    #1024,d0
  1066.     move.l    ($4).L,a6
  1067.     jsr    _LVOFreeMem(a6)        ; Free buffer for bootblock
  1068.  
  1069.     move.l    window2(pc),a0
  1070.     bsr    waitforclose        ; Wait for closegadget
  1071.  
  1072.     move.l    IntuitionBase(pc),a6
  1073.     move.l    window2(pc),a0
  1074.     jsr    _LVOCloseWindow(a6)
  1075.     clr.l    d0            ; No WATCH Gadget
  1076.     rts
  1077.  
  1078. ;====================================
  1079. ;= Routine for installing your disk =
  1080. ;====================================
  1081.  
  1082. installdisk:
  1083.     move.w    #300,hsize
  1084.     move.w    #50,hsize+2        ; Adjust height
  1085.     lea.l    InstallTitle(pc),a0
  1086.     move.l    a0,title2
  1087.     move.l    IntuitionBase(pc),a6
  1088.     lea.l    NewWindowStructure2(pc),a0
  1089.     jsr    _LVOOpenWindow(a6)
  1090.     move.l    d0,window2
  1091.     move.l    d0,a0
  1092.     move.l    wd_RPort(a0),rp2
  1093.  
  1094.     move.l    ($4).L,a6
  1095.     move.l    #1024,d0
  1096.     move.l    #2+1<<16,d1        ; Cleared Chip memory needed
  1097.     jsr    _LVOAllocMem(a6)    ; Allocate buffer for bootblock
  1098.     move.l    d0,buffer
  1099.     beq    skip_install        ; Prevent a guru
  1100.     
  1101.     lea.l    bootcode(pc),a0
  1102.     move.l    d0,a1
  1103.     move.l    #bootendcode-bootcode-1,d1
  1104. 1$    move.b    (a0)+,(a1)+        ; Copy bootblock into buffer
  1105.     dbra    d1,1$            
  1106.     lea.l    StandardBootBlock(pc),a0
  1107.     move.l    #Standardend-StandardBootBlock-1,d1
  1108. 2$    move.b    (a0)+,(a1)+
  1109.     dbra    d1,2$
  1110.  
  1111.     bsr    sum
  1112.     bsr    writebuffer
  1113.  
  1114.     move.l    buffer(pc),a1
  1115.     move.l    #1024,d0
  1116.     move.l    ($4).L,a6
  1117.     jsr    _LVOFreeMem(a6)        ; Free buffer for bootblock
  1118.  
  1119.     tst.b   io_error
  1120.     bne.s    3$            ; An error has occured
  1121.     move.l    #install_message,Mt5
  1122.     move.l    #install_message,Mt6
  1123.     bra.s    install_m
  1124. 3$    move.b    io_error,d0
  1125.     cmp.b    #28,d0            ; disk protected???
  1126.     bne.s    4$
  1127.     move.l    #disk_protected,Mt5
  1128.     move.l    #disk_protected,Mt6
  1129.     bra    install_m
  1130. 4$    cmp.b    #29,d0            ; disk changed ????
  1131.     bne    5$
  1132.     move.l    #disk_changed,Mt5
  1133.     move.l    #disk_changed,Mt6
  1134.     bra.s    install_m
  1135. 5$    move.l    #install_fail,Mt5    ; Unknown failure
  1136.     move.l    #install_fail,Mt6
  1137. install_m
  1138.     move.l    rp2(pc),a0
  1139.     clr.l    d0
  1140.     clr.l    d1
  1141.     lea.l    MyTekst5(pc),a1
  1142.     move.l    IntuitionBase(pc),a6
  1143.     jsr    _LVOPrintIText(a6)
  1144.     
  1145.  
  1146.     move.l    window2(pc),a0
  1147.     bsr    waitforclose        ; Wait for closegadget
  1148.  
  1149. skip_install:
  1150.     move.l    IntuitionBase(pc),a6
  1151.     move.l    window2(pc),a0
  1152.     jsr    _LVOCloseWindow(a6)
  1153.     clr.l    d0            ; No WATCH Gadget
  1154.     rts
  1155.  
  1156. ;=============================================
  1157. ;= Routine for displaying a part of ExecBase =
  1158. ;=============================================
  1159.  
  1160.  
  1161. viewmemory:
  1162.     move.w    #318,hsize
  1163.     move.w    #100,hsize+2        ; Adjust height
  1164.     lea.l    ViewTitle(pc),a0
  1165.     move.l    a0,title2
  1166.     move.l    IntuitionBase(pc),a6
  1167.     lea.l    NewWindowStructure2(pc),a0
  1168.     jsr    _LVOOpenWindow(a6)
  1169.     move.l    d0,window2
  1170.     move.l    d0,a0
  1171.     move.l    wd_RPort(a0),rp2
  1172.  
  1173.     move.l    ($4).L,a6
  1174.     move.l    #5*80,d0
  1175.     move.l    #1<<16,d1            
  1176.     jsr    _LVOAllocMem(a6)    ; Allocate buffer
  1177.     move.l    d0,buffer
  1178.     move.l    d0,-(a7)
  1179.  
  1180.     move.l    d0,MTE8
  1181.     move.l    d0,MTE8b
  1182.     add.l    #80,d0
  1183.     move.l    d0,MTE9
  1184.     move.l    d0,MTE9b
  1185.     add.l    #80,d0
  1186.     move.l    d0,MTE10
  1187.     move.l    d0,MTE10b
  1188.     add.l    #80,d0
  1189.     move.l    d0,MTE11
  1190.     move.l    d0,MTE11b
  1191.     add.l    #80,d0
  1192.     move.l    d0,MTE12
  1193.     move.l    d0,MTE12b
  1194.  
  1195.  
  1196.  
  1197. ;======== ColdCapture ==============
  1198.  
  1199.     lea.l    coldcapture(pc),a0
  1200.     move.l    buffer(pc),a1
  1201.     bsr    stringcopy
  1202.     
  1203.     move.l    ($4).L,a6
  1204.     move.l    42(a6),a0
  1205.     bsr    makestring
  1206.  
  1207.  
  1208. ;======= CoolCapture =============
  1209.  
  1210.     add.l    #80,buffer    
  1211.     lea.l    coolcapture(pc),a0
  1212.     move.l    buffer(pc),a1
  1213.     bsr    stringcopy
  1214.     
  1215.     move.l    ($4).L,a6
  1216.     move.l    46(a6),a0
  1217.     bsr    makestring
  1218.  
  1219.  
  1220. ;======== KickMemPtr ===============
  1221.  
  1222.     add.l    #80,buffer
  1223.     lea.l    kickmemptr(pc),a0
  1224.     move.l    buffer(pc),a1
  1225.     bsr    stringcopy
  1226.     
  1227.     move.l    ($4).L,a6
  1228.     move.l    546(a6),a0
  1229.     bsr    makestring
  1230.  
  1231.  
  1232. ;========== KickTagPtr ================
  1233.  
  1234.     add.l    #80,buffer
  1235.     lea.l    kicktagptr(pc),a0
  1236.     move.l    buffer(pc),a1
  1237.     bsr    stringcopy
  1238.     
  1239.     move.l    ($4).L,a6
  1240.     move.l    550(a6),a0
  1241.     bsr    makestring
  1242.  
  1243. ;==== DoIO =========================
  1244.  
  1245.     add.l    #80,buffer
  1246.     lea.l    doio_vector(pc),a0
  1247.     move.l    buffer(pc),a1
  1248.     bsr    stringcopy
  1249.     
  1250.     move.l    ($4).L,a6
  1251.     move.l    -454(a6),a0
  1252.     bsr    makestring
  1253.  
  1254. ;===== Rad ============================
  1255.  
  1256.     move.l    ($4).L,a6
  1257.     lea.l    TaskName(pc),a1
  1258.     jsr    _LVOFindTask(a6)
  1259.     tst.l    d0
  1260.     beq.s    no_rad            ; No rad
  1261.     move.l    #found_rad,MTE13
  1262.     move.l    #found_rad,MTE13b
  1263.     bra.s    rad_cont
  1264. no_rad    move.l    #no_found_rad,MTE13
  1265.     move.l    #no_found_rad,MTE13b
  1266. rad_cont:
  1267.  
  1268.     move.l    rp2,a0
  1269.     clr.l    d0
  1270.     clr.l    d1
  1271.     lea.l    IText8(pc),a1
  1272.     move.l    IntuitionBase(pc),a6
  1273.     jsr    _LVOPrintIText(a6)
  1274.     
  1275.     move.l    ($4).L,a6
  1276.     move.l    #5*80,d0
  1277.     move.l    (a7)+,a1            
  1278.     jsr    _LVOFreeMem(a6)        ; Free  buffer
  1279.     
  1280.     move.l    window2(pc),a0
  1281.     bsr    waitforclose
  1282.  
  1283.     move.l    IntuitionBase(pc),a6
  1284.     move.l    window2(pc),a0
  1285.     jsr    _LVOCloseWindow(a6)
  1286.  
  1287.     clr.l    d0            ; No WATCH Gadget
  1288.     rts
  1289.  
  1290. ;==============
  1291. ;= Makestring =
  1292. ;==============
  1293.  
  1294. makestring:
  1295.     move.l    ($4).L,a6
  1296.     lea.l    number(pc),a1
  1297.     bsr.s    convert
  1298.  
  1299.     lea.l    number(pc),a1
  1300.     move.l    buffer(pc),a0
  1301.     bsr.s    stringadd
  1302.     rts
  1303.  
  1304. ;========================
  1305. ;= Copy string a0 -> a1 =
  1306. ;========================
  1307.  
  1308. stringcopy:
  1309. 1$    move.b    (a0)+,(a1)+
  1310.     bne.s     1$
  1311.     rts
  1312.  
  1313. ;==============================
  1314. ;= Add string a1 to string a0 =
  1315. ;==============================
  1316.  
  1317. stringadd:
  1318.     move.l    a2,-(a7)
  1319. 1$    cmp.b    #0,(a0)+        ; Find end of string a0
  1320.     bne.s    1$
  1321.     subq    #1,a0
  1322.     move.l    a0,a2
  1323.     move.l    a1,a0
  1324.     move.l    a2,a1
  1325.     bsr.s    stringcopy        ; Paste a1 to a0
  1326.     move.l    (a7)+,a2
  1327.     rts
  1328.  
  1329. ;==========================================
  1330. ;= Convert value in a0 to buffer a1 (Hex) =
  1331. ;==========================================
  1332.  
  1333. convert:
  1334.     movem.l    d2-d3/a2,-(a7)
  1335.     lea.l    convtable(pc),a2
  1336.     move.l    a0,d1
  1337.     moveq    #7,d3
  1338. 1$    move.l    d1,d2
  1339.     and.l    #$f,d2
  1340.     move.l    d2,d0
  1341.     move.b    0(a2,d0),-(a7)
  1342.     lsr.l    #4,d1
  1343.     dbra    d3,1$
  1344.     moveq    #7,d3
  1345. 2$    move.b    (a7)+,(a1)+
  1346.     dbra    d3,2$
  1347.     movem.l    (a7)+,d2-d3/a2
  1348.     rts
  1349.  
  1350.  
  1351.  
  1352.  
  1353. ;=========================================
  1354. ;= Calculates lenght of string in buffer =
  1355. ;= Returns lenght in d0                  =
  1356. ;=========================================
  1357.  
  1358. length:
  1359.     clr.l    d0
  1360.     move.l    a5,-(a7)
  1361.     move.l    buffer,a5
  1362. 1$    addq    #1,d0
  1363.     cmp.b    #0,(a5)+
  1364.     bne.s    1$
  1365.     subq    #1,d0
  1366.     move.l    (a7)+,a5
  1367.     rts
  1368. ;=======================================
  1369. ;= Waits for closegadget to be pressed =
  1370. ;=======================================
  1371.  
  1372. waitforclose:
  1373.     move.l    ($4).L,a6
  1374.     move.l    a5,-(a7)
  1375.     move.l  a0,a5
  1376. 1$    move.l    a5,a0
  1377.     move.l    wd_UserPort(a0),a0
  1378.     move.l    a0,-(a7)
  1379.     moveq    #0,d1
  1380.     move.b    mp_SigBit(a0),d1
  1381.     moveq    #1,d0
  1382.     asl.l    d1,d0
  1383.     jsr    _LVOWait(a6)    ; Wait for an event
  1384.     move.l    (a7)+,a0    ; Get UserPort
  1385.     jsr    _LVOGetMsg(a6)    ; Get Message from IDCMP Port
  1386.     move.l    d0,a1
  1387.     move.l    im_Class(a1),d4
  1388.     jsr    _LVOReplyMsg(a6) ; Reply the message
  1389.  
  1390.     cmp.l    #CLOSEWINDOW,d4
  1391.     bne.s    1$
  1392.     move.l    (a7)+,a5
  1393.     rts
  1394.  
  1395.  
  1396. ;========================================
  1397. ;= Prints current virusstatus in window =
  1398. ;========================================
  1399.  
  1400. printstatus:
  1401.     move.l    window(pc),a0
  1402.     move.l    wd_RPort(a0),a1
  1403.     move.l    a1,rp        ; Store RastPort
  1404.  
  1405.     moveq    #0,d1
  1406.     move.b    signal(pc),d1
  1407.     beq.s    1$        ; No extra message needed (=Clean)
  1408.     cmp.b    #2,d1
  1409.     beq.s    1$        ; The same...
  1410.     move.l    #message,Mt3    ; System has been modified!
  1411.     move.l    #message,Mt4
  1412.     bra    12$
  1413.  
  1414. 1$    move.l    rp(pc),a0        ; Clear message box
  1415.     clr.    d0
  1416.     clr.l    d1
  1417.     lea.l    MyTekst3a(pc),a1
  1418.     move.l    IntuitionBase(pc),a6
  1419.     jsr    _LVOPrintIText(a6)
  1420.     
  1421.     move.l    #L9,Mt3        ; Clear previous(?) message!
  1422.     move.l    #L9,Mt4
  1423.     
  1424.  
  1425. 12$    move.l    rp(pc),a0
  1426.     clr.    d0
  1427.     clr.l    d1
  1428.     move.l    #MyTekst3,a1
  1429.     move.l    IntuitionBase(pc),a6
  1430.     jsr    _LVOPrintIText(a6)
  1431.     
  1432.     move.b    signal,d1
  1433.     cmp.b    #0,d1
  1434.     bne.s    2$
  1435.     lea.l    L0(pc),a0
  1436.     bra.s    10$
  1437. 2$    cmp.b    #1,d1
  1438.     bne.s    3$
  1439.     lea.l    L1(pc),a0
  1440.     bra.s    10$
  1441. 3$    cmp.b    #2,d1
  1442.     bne.s    4$
  1443.     lea.l    L2(pc),a0
  1444.     bra.s    10$
  1445. 4$    cmp.b    #3,d1
  1446.     bne.s    5$
  1447.     lea.l    L3(pc),a0
  1448.     bra.s    10$
  1449. 5$    cmp.b    #4,d1
  1450.     bne.s    6$
  1451.     lea.l    L4(pc),a0
  1452.     bra.s    10$
  1453. 6$    cmp.b    #5,d1
  1454.     bne.s    7$
  1455.     lea.l    L5(pc),a0
  1456.     bra.s    10$
  1457. 7$    cmp.b    #6,d1
  1458.     bne.s    8$
  1459.     lea.l    L6(pc),a0
  1460.     bra.s    10$
  1461. 8$    cmp.b    #7,d1
  1462.     bne.s    9$
  1463.     lea.l    L7(pc),a0
  1464.     bra.s    10$
  1465. 9$    cmp.b    #8,d1
  1466.     bne.s    11$
  1467.     lea.l    L8(pc),a0
  1468. 10$    move.l    a0,Mt1
  1469.     move.l    a0,Mt2
  1470.     move.l    rp,a0
  1471.     lea.l    MyTekst(pc),a1
  1472.     clr.l    d0
  1473.     clr.l    d1
  1474.     move.l    IntuitionBase(pc),a6
  1475.     jsr    _LVOPrintIText(a6)
  1476. 11$    rts
  1477.  
  1478.  
  1479. ;======================================
  1480. ;= Prints buffer in ascii on a window =
  1481. ;======================================
  1482.  
  1483. printbuffer:
  1484.     move.l    buffer(pc),a3
  1485.     move.l    a3,a4
  1486.     move.l    #1023,d1
  1487.     clr.l    d0
  1488. cloop    move.b    (a3)+,d0
  1489.     cmp.b    #31,d0
  1490.     bls.s    outrange
  1491.     cmp.b    #127,d0
  1492.     bhs.s    outrange
  1493.     move.b    d0,(a4)+
  1494.     dbra    d1,cloop
  1495.     bra.s    printit
  1496. outrange:
  1497.     move.b    #'.',(a4)+
  1498.     dbra    d1,cloop
  1499. printit:
  1500.     move.l    window2(pc),a0
  1501.     move.l    wd_RPort(a0),rp2
  1502.     moveq    #0,d3
  1503.     move.l    buffer(pc),a3
  1504. ploop    move.l    d3,d1
  1505.     mulu    #8,d1
  1506.     add.l    #20,d1
  1507.     move.w    d1,y1
  1508.     subq    #1,d1
  1509.     move.w    d1,y2
  1510.  
  1511.     
  1512.     lea.l    dummy(pc),a2
  1513.     move.l    d3,d1
  1514.     mulu    #64,d1
  1515.     move.l    a3,a0
  1516.     add.l    d1,a0
  1517.     moveq    #63,d0
  1518. 1$    move.b    (a0)+,(a2)+        ; copy string to dummy
  1519.     dbra    d0,1$
  1520.     move.b    #0,(a2)            ; end string with 0
  1521.  
  1522.     clr.l    d0
  1523.     clr.l    d1
  1524.     move.l    rp2(pc),a0
  1525.     lea.l    IText14(pc),a1
  1526.     move.l    IntuitionBase(pc),a6
  1527.     jsr    _LVOPrintIText(a6)
  1528.  
  1529.     addq    #1,d3
  1530.     cmp.l    #15,d3
  1531.     bls.s    ploop
  1532.     rts
  1533.  
  1534. ;============================
  1535. ;= Read bootblock in buffer =
  1536. ;============================
  1537.  
  1538. readbootblock:
  1539.     move.w    #READ,commando
  1540.     bsr.s    bootio
  1541.     rts
  1542.  
  1543. ;=============================
  1544. ;= Write buffer to bootblock =
  1545. ;=============================
  1546.  
  1547. writebuffer:
  1548.     move.w    #WRITE,commando
  1549.     bsr.s    bootio
  1550.     rts
  1551.  
  1552.  
  1553. ;==========================================
  1554. ;= Multi function boot read/write routine =
  1555. ;=                      =
  1556. ;= io_error contains error on exit      =
  1557. ;=                      =
  1558. ;==========================================
  1559.  
  1560. bootio:
  1561.     move.l    ($4).L,a6
  1562.     move.l    DoIOVector(pc),a5     ; ?????????????????????????
  1563.     sub.l    a1,a1
  1564.     jsr    _LVOFindTask(a6)
  1565.     move.l    d0,readreply+$10
  1566.     lea.l    readreply(pc),a1
  1567.     jsr    _LVOAddPort(a6)
  1568.     lea.l    diskio(pc),a1
  1569.     moveq    #0,d0
  1570.     move.b    drive,d0
  1571.     clr.l    d1
  1572.     lea.l    devicename(pc),a0
  1573.     jsr    _LVOOpenDevice(a6)
  1574.     tst.l    d0
  1575.     beq.s    tskip
  1576.     lea.l    readreply(pc),a1
  1577.     jsr    _LVORemPort(a6)
  1578.     bra    trackerror
  1579. tskip    lea.l    diskio(pc),a1
  1580.     move.l    buffer,40(a1)
  1581.     move.l    #readreply,14(a1)
  1582.     move.w    #TD_CHANGESTATE,28(a1)
  1583.     jsr    (a5)                ; Jump into Rom !!!!
  1584.     move.l    diskio+32,d6
  1585.     beq.s    tskip2
  1586.     move.b    #29,io_error
  1587.     bra    terror                ; No disk!
  1588.  
  1589. tskip2    move.w    commando,d5
  1590.     cmp.w    #READ,d5
  1591.     bne.s    1$                ; Don't CMD_CLEAR for a write
  1592.     lea.l    diskio(pc),a1            ; We will read a bootblock
  1593.     move.l    buffer(pc),40(a1)
  1594.     move.l    #readreply,14(a1)        ; so, force a reading
  1595.     move.w    #5,28(a1)
  1596.     jsr    (a5)        ; CMD_Clear (Clear trackbuffer)
  1597.  
  1598. 1$    lea.l    diskio(pc),a1
  1599.     move.l    #readreply,14(a1)
  1600.     move.w    commando,28(a1)
  1601.     move.l    buffer(pc),40(a1)
  1602.     move.l    #1024,36(a1)
  1603.     move.l    #0,44(a1)
  1604.     move.l    ($4).L,a6
  1605.     jsr    (a5)
  1606.     move.b    diskio+31,io_error        ; Error number
  1607.  
  1608.     move.w    commando,d5
  1609.     cmp.w    #WRITE,d5
  1610.     bne.s    2$
  1611.  
  1612.     lea.l    diskio(pc),a1
  1613.     move.l    buffer(pc),40(a1)
  1614.     move.l    #readreply,14(a1)
  1615.     move.w    #4,28(a1)        ; CMD_UPDATE
  1616.     move.l    ($4).L,a6
  1617.     jsr    (a5)        ; Write all buffers out
  1618.     move.b    diskio+31,io_error    ; Get error number
  1619.  
  1620. 2$    tst.b    io_error
  1621.     beq.s    tgood
  1622. terror    lea.l    errormessage(pc),a1
  1623.     move.l    window2(pc),a0
  1624.     move.l    #0,a2
  1625.     move.l    IntuitionBase(pc),a6
  1626.     jsr    _LVOSetWindowTitles(a6)
  1627.     move.l    ($4).L,a6
  1628.     
  1629. tgood    lea.l    diskio(pc),a1
  1630.     move.w    #9,28(a1)        ; TD_MOTOR
  1631.     move.l    #0,36(a1)
  1632.     jsr    (a5)
  1633.  
  1634.     lea.l    readreply(pc),a1
  1635.     jsr    _LVORemPort(a6)
  1636.     lea.l    diskio(pc),a1
  1637.     jsr    _LVOCloseDevice(a6)
  1638.  
  1639. trackerror:
  1640.     rts
  1641.  
  1642. ;================================
  1643. ;= The maincode of my Bootblock =
  1644. ;================================
  1645.  
  1646. bootcode:
  1647.     dc.b    'DOS',0
  1648.     dc.l    0
  1649. root    dc.l    880
  1650. main    move.l    ($4).L,a6
  1651.     lea.l    Dosname(pc),a1
  1652.     jsr    _LVOFindResident(a6)
  1653.     move.l    d0,a0
  1654.     move.l    22(a0),a0
  1655.     clr.l    d0
  1656.     rts
  1657. Dosname    dc.b    'dos.library',0
  1658. bootendcode:
  1659.  
  1660. ;=========================================================
  1661. ;= Routine which calculates the checksum of my bootblock =
  1662. ;=========================================================
  1663.     even
  1664.  
  1665. sum    clr.l    d0
  1666.     move.l    buffer(pc),a0
  1667.     move.l    #255,d1
  1668. sumloop    add.l    (a0)+,d0
  1669.     bcc.s    sumcont
  1670.     addq    #1,d0
  1671. sumcont    dbra    d1,sumloop
  1672.     moveq    #-1,d1
  1673.     sub.l    d0,d1
  1674.     move.l    buffer,a2
  1675.     move.l    d1,4(a2)
  1676.     rts
  1677.  
  1678. ;=====================================
  1679. ;= This routine will spawn a new cli =
  1680. ;=====================================
  1681.  
  1682. newcli:
  1683.     lea.l    commandstring(pc),a0
  1684.     bra    cont
  1685.  
  1686. do_function_keys:
  1687.     cmp.w    #FUNC_F2,d0
  1688.     bne    1$
  1689.     lea.l    script2(pc),a0
  1690.     bra    cont
  1691. 1$    cmp.w    #FUNC_F3,d0
  1692.     bne    2$
  1693.     lea.l    script3(pc),a0
  1694.     bra    cont
  1695. 2$    cmp.w    #FUNC_F4,d0
  1696.     bne    3$
  1697.     lea.l    script4(pc),a0
  1698.     bra    cont
  1699. 3$    cmp.w    #FUNC_F5,d0
  1700.     bne    4$
  1701.     lea.l    script5(pc),a0
  1702.     bra    cont
  1703. 4$    cmp.w    #FUNC_F6,d0
  1704.     bne    5$
  1705.     lea.l    script6(pc),a0
  1706.     bra    cont
  1707. 5$    cmp.w    #FUNC_F7,d0
  1708.     bne    6$
  1709.     lea.l    script7(pc),a0
  1710.     bra    cont
  1711. 6$    cmp.w    #FUNC_F8,d0
  1712.     bne    7$
  1713.     lea.l    script8(pc),a0
  1714.     bra    cont
  1715. 7$    cmp.w    #FUNC_F9,d0
  1716.     bne    8$
  1717.     lea.l    script9(pc),a0
  1718.     bra    cont
  1719. 8$    cmp.w    #FUNC_F10,d0
  1720.     bne    ret
  1721.     lea.l    script10(pc),a0
  1722. cont    move.l    a0,d1
  1723.     move.l    pcb_Input,d2
  1724.     move.l    pcb_Output,d3
  1725.     move.l    DOSBase(pc),a6
  1726.     jsr    _LVOExecute(a6)
  1727.  
  1728. ret    move.b    #0,keyfound
  1729.     clr.l    d0
  1730.     rts    
  1731.  
  1732.  
  1733.  
  1734. ;====================================
  1735. ;= Help routine: shows credits+help =
  1736. ;====================================
  1737.  
  1738. showhelp:
  1739.     move.w    #450,hsize
  1740.     move.w    #130,hsize+2        ; Adjust height
  1741.     move.l    #HelpTitle,title2
  1742.     move.l    IntuitionBase(pc),a6
  1743.     lea.l    NewWindowStructure2,a0
  1744.     jsr    _LVOOpenWindow(a6)
  1745.     move.l    d0,window2
  1746.     move.l    d0,a0
  1747.     move.l    wd_RPort(a0),a0
  1748.     lea.l    Text15(pc),a1
  1749.     clr.l    d0
  1750.     clr.l    d1
  1751.     jsr    _LVOPrintIText(a6)
  1752.  
  1753.     move.l    window2(pc),a0
  1754.     bsr    waitforclose
  1755.  
  1756.     move.l    IntuitionBase(pc),a6
  1757.     move.l    window2(pc),a0
  1758.     jsr    _LVOCloseWindow(a6)
  1759.  
  1760.     clr.l    d0
  1761.     rts
  1762.  
  1763. ;===========================
  1764. ;= The preference routines =
  1765. ;===========================
  1766.  
  1767. preferences
  1768.     movem.l    d0-d6/a0-a6,-(a7)
  1769.     move.l    IntuitionBase(pc),a6
  1770.     lea.l    NewWindowStructure3(pc),a0
  1771.     jsr    _LVOOpenWindow(a6)
  1772.     move.l    d0,window3
  1773.     beq    pout
  1774.     move.l    d0,a0
  1775.     move.l    wd_RPort(a0),a0
  1776.     lea.l    Text24(pc),a1
  1777.     clr.l    d0
  1778.     clr.l    d1
  1779.     jsr    _LVOPrintIText(a6)
  1780.     
  1781.     move.b    patchstatus,tempstatus
  1782.     bsr    reflect
  1783.  
  1784. plook    move.l    window3(pc),a0
  1785.     move.l    ($4).L,a6
  1786.     move.l    wd_UserPort(a0),a0
  1787.     move.l    a0,-(a7)
  1788.     moveq    #0,d1
  1789.     move.b    mp_SigBit(a0),d1
  1790.     moveq    #1,d0
  1791.     asl.l    d1,d0
  1792.     jsr    _LVOWait(a6)    ; Wait for an event
  1793.     move.l    (a7)+,a0    ; Get UserPort
  1794.     jsr    _LVOGetMsg(a6)    ; Get Message from IDCMP Port
  1795.     move.l    d0,a1
  1796.     move.l    im_Class(a1),d4
  1797.     move.l    im_Address(a1),d5
  1798.     jsr    _LVOReplyMsg(a6) ; Reply the message
  1799.  
  1800.     cmp.l    #CLOSEWINDOW,d4
  1801.     beq.s    p_cancel
  1802.     cmp.l    #GADGETUP,d4
  1803.     bne    plook
  1804.     move.l    d5,a1
  1805.     move.w    GadgetID(a1),d0
  1806.  
  1807.     
  1808.  
  1809.     cmp.w    #USE,d0
  1810.     beq    p_use
  1811.     cmp.w    #CANCEL,d0
  1812.     beq    p_cancel
  1813.     cmp.w    #SAVE,d0
  1814.     beq    p_save
  1815.     cmp.w    #NOCARE,d0
  1816.     beq    p_nocare
  1817.     cmp.w    #MOUSEACC,d0
  1818.     beq    p_mouse
  1819.     cmp.w    #FUNCTIONKEYS,d0
  1820.     bne    plook
  1821. p_functionkeys:
  1822.     eor.b    #FUNCTION_PATCH,tempstatus
  1823.     bra    plook
  1824. p_use:    
  1825.     move.b    tempstatus,patchstatus
  1826.     bra    pexit
  1827. p_cancel
  1828.     bra    pexit
  1829. p_save
  1830.     move.b    tempstatus,patchstatus
  1831.     bsr    Saddam
  1832.     bsr    save_prefs
  1833.     bra    pexit
  1834. p_nocare
  1835.     eor.b    #NOCARE_PATCH,tempstatus
  1836.     bra    plook
  1837. p_mouse
  1838.     eor.b    #MOUSE_PATCH,tempstatus
  1839.     bra    plook
  1840.  
  1841. pexit    move.l    IntuitionBase(pc),a6
  1842.     move.l    window3(pc),a0
  1843.     jsr    _LVOCloseWindow(a6)
  1844.     bsr    reflect
  1845.     btst.b    #0,patchstatus(pc)
  1846.     bne.s    1$
  1847.     bsr    nocare_off
  1848.     bra.s    2$
  1849. 1$    bsr    nocare
  1850. 2$    movem.l    (a7)+,d0-d6/a0-a6
  1851. pout    clr.l    d0
  1852.     rts
  1853.  
  1854.  
  1855.  
  1856. reflect:
  1857.     clr.w    d1
  1858.     move.b    patchstatus(pc),d0
  1859.     move.b    d0,d1
  1860.     and.b    #1,d1
  1861.     lsl.w    #7,d1
  1862.     and.w    #$ff7f,tog1
  1863.     or.w    d1,tog1
  1864.     clr.w    d1
  1865.     move.b    d0,d1
  1866.     and.b    #2,d1
  1867.     lsl.w    #6,d1
  1868.     and.w    #$ff7f,tog2
  1869.     or.w    d1,tog2
  1870.     clr.w    d1
  1871.     move.b    d0,d1
  1872.     and.b    #4,d1
  1873.     lsl.w    #5,d1
  1874.     and.w    #$ff7f,tog3
  1875.     or.w    d1,tog3
  1876.     rts
  1877.  
  1878.  
  1879.  
  1880.  
  1881. ;======================
  1882. ;= The reboot routine =
  1883. ;======================
  1884.  
  1885. reboot    bsr    yesno2                ; Want to reboot???
  1886.     tst.l    d0
  1887.     bne.s    1$                ; noop
  1888.     rts
  1889. 1$    move.l    ($4).L,a6
  1890.     move.l    #-1,$4
  1891.     cmp.w    #V36_EXEC,LIB_VERSION(a6)
  1892.     blt.s    old_exec
  1893.     jmp    TEMP_ColdReboot(a6)     ;Let Exec do it...
  1894.     ;NOTE: Control flow never returns to here
  1895.  
  1896.  
  1897. old_exec:    
  1898.     lea.l    GoAway(pc),a5           ;address of code to execute
  1899.     jsr    _LVOSupervisor(a6)      ;trap to code at (a5)...
  1900.     ;NOTE: Control flow never returns to here
  1901.  
  1902.  
  1903. ;-------------- MagicResetCode ---------DO NOT CHANGE-----------------------
  1904.  
  1905.         CNOP    0,4            ;IMPORTANT! Longword align!
  1906. GoAway:     lea.l    (MAGIC_ROMEND).L,a0     ;(end of ROM)
  1907.         sub.l    MAGIC_SIZEOFFSET(a0),a0 ;(end of ROM)-(ROM size)=PC
  1908.         move.l    4(a0),a0                ;Get Initial Program Counter
  1909.         subq.l    #2,a0            ;now points to second RESET
  1910.         reset                ;first RESET instruction
  1911.         jmp    (a0)                    ;CPU Prefetch executes this
  1912.         ;NOTE: the RESET and JMP instructions must share a longword!
  1913.  
  1914. ;---------------------------------------DO NOT CHANGE-----------------------
  1915.  
  1916.  
  1917.  
  1918. ;=======================
  1919. ;= The Cleanup Routine =
  1920. ;=======================
  1921.  
  1922. exit    move.l    $4,a6
  1923.     move.b    #DIE,status
  1924.     bsr    nocare_off        ; Remove Nocare patch
  1925.     move.l    $4,a6
  1926.     lea.l    InputRequestBlock(pc),a0
  1927.     move.w    #IND_REMHANDLER,io_Command(a0)
  1928.     move.l    #HandlerStuff,io_Data(a0)
  1929.     move.l    a0,a1
  1930.     jsr    _LVODoIO(a6)        ; Remove handler
  1931.     lea.l    InputRequestBlock(pc),a0
  1932.     jsr    _LVOCloseDevice(a6)
  1933.  
  1934.     move.l    InputDevPort,a1
  1935.     jsr    _LVORemPort(a6)
  1936.  
  1937.     move.l    InputDevPort,a1
  1938.     move.l    #mp_Size,d0
  1939.     jsr    _LVOFreeMem(a6)    
  1940.  
  1941. find    move.l    DOSBase,a6        ; Give Check Task time to die
  1942.     move.l    #25,d1            ; as I have a pri of 2
  1943.     jsr    _LVODelay(a6)
  1944.     move.l    $4,a6
  1945.     lea.l    CHECK_NAME(pc),a1
  1946.     jsr    _LVOFindTask(a6)
  1947.     tst.l    d0
  1948.     bne.s    find            ; Wait until Check Task is dead
  1949.  
  1950.     move.l    checktask(pc),a1
  1951.     move.l    #TC_SIZE,d1
  1952.     jsr    _LVOFreeMem(a6)        ; Free Memory of check task
  1953.  
  1954.     move.l    ($4).L,a6
  1955.     move.l    GfxBase,a1
  1956.     jsr    _LVOCloseLibrary(a6)
  1957. nographics:
  1958.     move.l    IntuitionBase(pc),a1
  1959.     jsr    _LVOCloseLibrary(a6)
  1960. nointuition:
  1961.     move.l    DOSBase(pc),a1
  1962.     jsr    _LVOCloseLibrary(a6)
  1963. nodos    jsr    _LVODisable(a6)        ; Disable interupts (avoid AllocMem's)
  1964.     move.l    DOSBase(pc),a6         ; Assume Dos hasn't moved (???)
  1965.     move.l    #mymain,d1
  1966.     sub.l    #4,d1
  1967.     lsr.l    #2,d1            ; make BPTR !!!!!!
  1968.     jsr    _LVOUnLoadSeg(a6)    ; Unload this code
  1969.     move.l    $4,a6
  1970.     move.l    #0,a1
  1971.     jsr    _LVORemTask(a6)        ; Kill myself
  1972.     rts
  1973.  
  1974.  
  1975. ;================
  1976. ;= Data section =
  1977. ;================
  1978.  
  1979.     Section "Main",data
  1980.  
  1981. Title    dc.b    'BigBrother V3.12 by EA van Breemen',10,13
  1982.     dc.b    169,'1992 Orega Holland.',10,13,0
  1983. Title_Size    equ    *-Title    
  1984.     even
  1985.  
  1986. Active_Title:
  1987.     dc.b    'BigBrother is already active.',10,13,0
  1988. Active_Size    equ    *-Active_Title    
  1989.     even
  1990.  
  1991. NewWindowStructure1:
  1992.     dc.w    62,30
  1993.     dc.w    330,130
  1994.     dc.b    1,3
  1995.     dc.l    GADGETUP+CLOSEWINDOW+RAWKEY
  1996.     dc.l    WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+ACTIVATE+NOCAREREFRESH
  1997.     dc.l    Gadget1
  1998.     dc.l    NULL
  1999.     dc.l    CopyrightName
  2000.     dc.l    NULL
  2001.     dc.l    NULL
  2002.     dc.w    5,5
  2003.     dc.w    -1,-1
  2004.     dc.w    WBENCHSCREEN
  2005. NewWindowStructure2:
  2006.     dc.w    0,0
  2007. hsize    dc.w    550,160
  2008.     dc.b    1,3
  2009.     dc.l    CLOSEWINDOW
  2010.     dc.l    ACTIVATE+NOCAREREFRESH+WINDOWCLOSE
  2011.     dc.l    NULL
  2012.     dc.l    NULL
  2013. title2    dc.l    InitTitle
  2014.     dc.l    NULL
  2015.     dc.l    NULL
  2016.     dc.w    5,5
  2017.     dc.w    -1,-1
  2018.     dc.w    WBENCHSCREEN
  2019.  
  2020. NewWindowStructure3:
  2021.     dc.w    0,0
  2022.     dc.w    400,150
  2023.     dc.b    1,3
  2024.     dc.l    CLOSEWINDOW+GADGETUP
  2025.     dc.l    ACTIVATE+NOCAREREFRESH+WINDOWCLOSE
  2026.     dc.l    Gadget10
  2027.     dc.l    NULL
  2028.     dc.l    PrefsTitle
  2029.     dc.l    NULL
  2030.     dc.l    NULL
  2031.     dc.w    5,5
  2032.     dc.w    -1,-1
  2033.     dc.w    WBENCHSCREEN
  2034.  
  2035. CopyrightName:
  2036.     dc.b 'Big Brother V3.12',0
  2037.     dc.b    ' ',169,'1989/1990',0
  2038.     cnop 0,2
  2039. InitTitle:
  2040.     dc.b    'BootBlock:',0
  2041.     even
  2042. ViewTitle:
  2043.     dc.b    'Contents of ExecBase:',0
  2044.     even
  2045. InstallTitle:
  2046.     dc.b    'Installing BootBlock',0
  2047.     even
  2048. HelpTitle:
  2049.     dc.b    'Help',0
  2050.     even
  2051. PrefsTitle:
  2052.     dc.b    'Preferences',0
  2053.     even
  2054. install_message:
  2055.     dc.b    'Disk has been installed',0
  2056.     even
  2057. install_fail:
  2058.     dc.b    'Install has failed',0
  2059.     even
  2060. disk_protected:
  2061.     dc.b    'Disk is write-protected!',0
  2062.     even
  2063. disk_changed:
  2064.     dc.b    'Disk has been removed!',0
  2065.     even
  2066. StandardBootBlock:
  2067.     dc.b    'Standard BootBlock by Orega Holland.'
  2068.     dc.b    ' Copyright 1989,1990. Installed by Big Brother V3.12'
  2069. Standardend:
  2070.     even
  2071. prefs_file:
  2072.     dc.b    's:big_prefs',0
  2073.     even
  2074. topaz80:
  2075.     dc.l    topazname
  2076.     dc.w    TOPAZ_EIGHTY
  2077.     dc.b    0,0
  2078. topazname:
  2079.     dc.b    'topaz.font',0
  2080.     even
  2081.  
  2082. Gadget1:
  2083.     dc.l    Gadget2
  2084.     dc.w    29,22
  2085.     dc.w    80,15
  2086.     dc.w    GADGHIMAGE
  2087.     dc.w    RELVERIFY
  2088.     dc.w    BOOLGADGET
  2089.     dc.l    Border1
  2090.     dc.l    RenderBorder1
  2091.     dc.l    IText1
  2092.     dc.l    NULL
  2093.     dc.l    NULL
  2094.     dc.w    DRIVE
  2095.     dc.l    NULL
  2096. Border1:
  2097.     dc.w    0,0
  2098.     dc.b    2,0,RP_JAM2
  2099.     dc.b    3
  2100.     dc.l    BorderVectors1
  2101.     dc.l    Border1a
  2102. Border1a:
  2103.     dc.w    0,0
  2104.     dc.b    1,0,RP_JAM2
  2105.     dc.b    3
  2106.     dc.l    BorderVectors1a
  2107.     dc.l    NULL
  2108. RenderBorder1:
  2109.     dc.w    0,0
  2110.     dc.b    1,0,RP_JAM2
  2111.     dc.b    3
  2112.     dc.l    BorderVectors1
  2113.     dc.l    RenderBorder1a
  2114. RenderBorder1a:
  2115.     dc.w    0,0
  2116.     dc.b    2,0,RP_JAM2
  2117.     dc.b    3
  2118.     dc.l    BorderVectors1a
  2119.     dc.l    NULL
  2120.  
  2121. BorderVectors1:
  2122.     dc.w    0,15
  2123.     dc.w    0,0
  2124.     dc.w    80,0
  2125. BorderVectors1a:
  2126.     dc.w    80,0
  2127.     dc.w    80,15
  2128.     dc.w    0,15    
  2129.  
  2130.  
  2131. ;======== Custom Drawing =======================
  2132.  
  2133. Border2:
  2134.     dc.w    30,96
  2135.     dc.b    2,0,RP_JAM2
  2136.     dc.b    3
  2137.     dc.l    BorderVectors2
  2138.     dc.l    Border3
  2139. Border3:
  2140.     dc.w    30,96
  2141.     dc.b    1,0,RP_JAM2
  2142.     dc.b    3
  2143.     dc.l    BorderVectors2a
  2144.     dc.l    NULL
  2145. BorderVectors2:            ; Tekstbox of mainwindow
  2146.     dc.w    0,26
  2147.     dc.w    0,0
  2148.     dc.w    280,0
  2149. BorderVectors2a:
  2150.     dc.w    280,0
  2151.     dc.w    280,26
  2152.     dc.w    0,26
  2153. MyTekst:
  2154.     dc.b    1,0,RP_JAM2,0
  2155.     dc.w    45,110
  2156.     dc.l    topaz80
  2157. Mt1    dc.l    NULL
  2158.     dc.l    MyTekst2
  2159. MyTekst2:
  2160.     dc.b    2,0,RP_JAM1,0
  2161.     dc.w    44,109
  2162.     dc.l    topaz80
  2163. Mt2    dc.l    NULL
  2164.     dc.l    NULL
  2165. MyTekst3:
  2166.     dc.b    1,0,RP_JAM2,0
  2167.     dc.w    45,100
  2168.     dc.l    topaz80
  2169. Mt3    dc.l    NULL
  2170.     dc.l    MyTekst4
  2171. MyTekst4:
  2172.     dc.b    2,0,RP_JAM1,0
  2173.     dc.w    44,99
  2174.     dc.l    topaz80
  2175. Mt4    dc.l    NULL
  2176.     dc.l    NULL
  2177.  
  2178.  
  2179. ;=====================================================
  2180. ;= IntuiText structures for clearing the message box =
  2181. ;=====================================================
  2182.  
  2183. MyTekst3a:
  2184.     dc.b    1,0,RP_JAM2,0
  2185.     dc.w    45,100
  2186.     dc.l    topaz80
  2187.     dc.l    L10
  2188.     dc.l    MyTekst4a
  2189. MyTekst4a:
  2190.     dc.b    1,0,RP_JAM2,0
  2191.     dc.w    44,99
  2192.     dc.l    topaz80
  2193.     dc.l    L10
  2194.     dc.l    MyTekst3b
  2195. MyTekst3b:
  2196.     dc.b    1,0,RP_JAM2,0
  2197.     dc.w    45,110
  2198.     dc.l    topaz80
  2199.     dc.l    L10
  2200.     dc.l    MyTekst4b
  2201. MyTekst4b:
  2202.     dc.b    1,0,RP_JAM2,0
  2203.     dc.w    44,109
  2204.     dc.l    topaz80
  2205.     dc.l    L10
  2206.     dc.l    NULL
  2207.  
  2208.  
  2209.  
  2210. MyTekst5:
  2211.     dc.b    1,0,RP_JAM2,0
  2212.     dc.w    40,25
  2213.     dc.l    topaz80
  2214. Mt5    dc.l    NULL
  2215.     dc.l    MyTekst6
  2216. MyTekst6:
  2217.     dc.b    2,0,RP_JAM1,0
  2218.     dc.w    39,24
  2219.     dc.l    topaz80
  2220. Mt6    dc.l    NULL
  2221.     dc.l    NULL
  2222.  
  2223. ;=====================================
  2224.  
  2225.  
  2226. IText1:
  2227.     dc.b    1,0,RP_JAM2,0
  2228.     dc.w    21,3
  2229.     dc.l    topaz80
  2230.     dc.l    DummyTekst
  2231.     dc.l    IText1a
  2232. IText1a:
  2233.     dc.b    1,0,RP_JAM2,0
  2234.     dc.w    22,4
  2235.     dc.l    topaz80
  2236.     dc.l    ITextText1
  2237.     dc.l    IText1b
  2238. IText1b:
  2239.     dc.b    2,0,RP_JAM1,0
  2240.     dc.w    21,3
  2241.     dc.l    topaz80
  2242.     dc.l    ITextText1
  2243.     dc.l    NULL
  2244.  
  2245. ITextText1:
  2246.     dc.b    'DF0:',0
  2247.     cnop 0,2
  2248. DummyTekst:
  2249.     dc.b    '    ',0
  2250.     cnop 0,2
  2251. Gadget2:
  2252.     dc.l    Gadget3
  2253.     dc.w    128,46
  2254.     dc.w    80,15
  2255.     dc.w    GADGHIMAGE
  2256.     dc.w    RELVERIFY
  2257.     dc.w    BOOLGADGET
  2258.     dc.l    Border1
  2259.     dc.l    RenderBorder1
  2260.     dc.l    IText2
  2261.     dc.l    NULL
  2262.     dc.l    NULL
  2263.     dc.w    MEMORY
  2264.     dc.l    NULL
  2265. IText2:
  2266.     dc.b    1,0,RP_JAM2,0
  2267.     dc.w    15,4
  2268.     dc.l    topaz80
  2269.     dc.l    ITextText2
  2270.     dc.l    IText2b
  2271. IText2b:
  2272.     dc.b    2,0,RP_JAM1,0
  2273.     dc.w    14,3
  2274.     dc.l    topaz80
  2275.     dc.l    ITextText2
  2276.     dc.l    NULL
  2277. ITextText2:
  2278.     dc.b    'Memory',0
  2279.     cnop 0,2
  2280. Gadget3:
  2281.     dc.l    Gadget4
  2282.     dc.w    229,22
  2283.     dc.w    80,15
  2284.     dc.w    GADGHIMAGE
  2285.     dc.w    RELVERIFY
  2286.     dc.w    BOOLGADGET
  2287.     dc.l    Border1
  2288.     dc.l    RenderBorder1
  2289.     dc.l    IText3
  2290.     dc.l    NULL
  2291.     dc.l    NULL
  2292.     dc.w    INSTALL
  2293.     dc.l    NULL
  2294.  
  2295. IText3:
  2296.     dc.b    1,0,RP_JAM2,0
  2297.     dc.w    13,4
  2298.     dc.l    topaz80
  2299.     dc.l    ITextText3
  2300.     dc.l    IText3b
  2301. IText3b:
  2302.     dc.b    2,0,RP_JAM1,0
  2303.     dc.w    12,3
  2304.     dc.l    topaz80
  2305.     dc.l    ITextText3
  2306.     dc.l    NULL
  2307. ITextText3:
  2308.     dc.b    'Install',0
  2309.     cnop 0,2
  2310. Gadget4:
  2311.     dc.l    Gadget5
  2312.     dc.w    29,46
  2313.     dc.w    80,15
  2314.     dc.w    GADGHIMAGE
  2315.     dc.w    RELVERIFY
  2316.     dc.w    BOOLGADGET
  2317.     dc.l    Border1
  2318.     dc.l    RenderBorder1
  2319.     dc.l    IText4
  2320.     dc.l    NULL
  2321.     dc.l    NULL
  2322.     dc.w    WATCH
  2323.     dc.l    NULL
  2324.  
  2325. IText4:
  2326.     dc.b    1,0,RP_JAM2,0
  2327.     dc.w    22,4
  2328.     dc.l    topaz80
  2329.     dc.l    ITextText4
  2330.     dc.l    IText4b
  2331. IText4b:
  2332.     dc.b    2,0,RP_JAM1,0
  2333.     dc.w    21,3
  2334.     dc.l    topaz80
  2335.     dc.l    ITextText4
  2336.     dc.l    NULL
  2337. ITextText4:
  2338.     dc.b    'Watch',0
  2339.     cnop 0,2
  2340. Gadget5:
  2341.     dc.l    Gadget6
  2342.     dc.w    229,46
  2343.     dc.w    80,15
  2344.     dc.w    GADGHIMAGE
  2345.     dc.w    RELVERIFY
  2346.     dc.w    BOOLGADGET
  2347.     dc.l    Border1
  2348.     dc.l    RenderBorder1
  2349.     dc.l    IText5
  2350.     dc.l    NULL
  2351.     dc.l    NULL
  2352.     dc.w    CLEAR
  2353.     dc.l    NULL
  2354.  
  2355. IText5:
  2356.     dc.b    1,0,RP_JAM2,0
  2357.     dc.w    22,4
  2358.     dc.l    topaz80
  2359.     dc.l    ITextText5
  2360.     dc.l    IText5b
  2361. IText5b:
  2362.     dc.b    2,0,RP_JAM1,0
  2363.     dc.w    21,3
  2364.     dc.l    topaz80
  2365.     dc.l    ITextText5
  2366.     dc.l    NULL
  2367. ITextText5:
  2368.     dc.b    'Clear',0
  2369.     cnop 0,2
  2370. Gadget6:
  2371.     dc.l    Gadget7
  2372.     dc.w    128,22
  2373.     dc.w    80,15
  2374.     dc.w    GADGHIMAGE
  2375.     dc.w    RELVERIFY
  2376.     dc.w    BOOLGADGET
  2377.     dc.l    Border1
  2378.     dc.l    RenderBorder1
  2379.     dc.l    IText6
  2380.     dc.l    NULL
  2381.     dc.l    NULL
  2382.     dc.w    VIEW
  2383.     dc.l    NULL
  2384.  
  2385. IText6:
  2386.     dc.b    1,0,RP_JAM2,0
  2387.     dc.w    22,4
  2388.     dc.l    topaz80
  2389.     dc.l    ITextText6
  2390.     dc.l    IText6b
  2391. IText6b:
  2392.     dc.b    2,0,RP_JAM1,0
  2393.     dc.w    21,3
  2394.     dc.l    topaz80
  2395.     dc.l    ITextText6
  2396.     dc.l    NULL
  2397. ITextText6:
  2398.     dc.b    'View',0
  2399.     even
  2400.     
  2401. Gadget7:
  2402.     dc.l    Gadget8
  2403.     dc.w    29,70
  2404.     dc.w    80,15
  2405.     dc.w    GADGHIMAGE
  2406.     dc.w    RELVERIFY
  2407.     dc.w    BOOLGADGET
  2408.     dc.l    Border1
  2409.     dc.l    RenderBorder1
  2410.     dc.l    IText7
  2411.     dc.l    NULL
  2412.     dc.l    NULL
  2413.     dc.w    NEWSHELL
  2414.     dc.l    NULL
  2415. IText7:
  2416.     dc.b    1,0,RP_JAM2,0
  2417.     dc.w    10,4
  2418.     dc.l    topaz80
  2419.     dc.l    ITextText7
  2420.     dc.l    IText7b
  2421. IText7b:
  2422.     dc.b    2,0,RP_JAM1,0
  2423.     dc.w    9,3
  2424.     dc.l    topaz80
  2425.     dc.l    ITextText7
  2426.     dc.l    NULL
  2427. ITextText7:
  2428.     dc.b    'NewShell',0
  2429.     
  2430.     even
  2431. Gadget8:
  2432.     dc.l    Gadget9
  2433.     dc.w    229,70
  2434.     dc.w    80,15
  2435.     dc.w    GADGHIMAGE
  2436.     dc.w    RELVERIFY
  2437.     dc.w    BOOLGADGET
  2438.     dc.l    Border1
  2439.     dc.l    RenderBorder1
  2440.     dc.l    _IText8
  2441.     dc.l    NULL
  2442.     dc.l    NULL
  2443.     dc.w    PREFS
  2444.     dc.l    NULL
  2445. _IText8:
  2446.     dc.b    1,0,RP_JAM2,0
  2447.     dc.w    23,4
  2448.     dc.l    topaz80
  2449.     dc.l    _ITextText8
  2450.     dc.l    _IText8b
  2451. _IText8b:
  2452.     dc.b    2,0,RP_JAM1,0
  2453.     dc.w    22,3
  2454.     dc.l    topaz80
  2455.     dc.l    _ITextText8
  2456.     dc.l    NULL
  2457. _ITextText8:
  2458.     dc.b    'Prefs',0
  2459.     
  2460.     even
  2461.  
  2462. Gadget9:
  2463.     dc.l    NULL
  2464.     dc.w    128,70
  2465.     dc.w    80,15
  2466.     dc.w    GADGHIMAGE
  2467.     dc.w    RELVERIFY
  2468.     dc.w    BOOLGADGET
  2469.     dc.l    Border1
  2470.     dc.l    RenderBorder1
  2471.     dc.l    _IT9
  2472.     dc.l    NULL
  2473.     dc.l    NULL
  2474.     dc.w    REBOOT
  2475.     dc.l    NULL
  2476. _IT9:
  2477.     dc.b    1,0,RP_JAM2,0
  2478.     dc.w    15,4
  2479.     dc.l    topaz80
  2480.     dc.l    _ITT9
  2481.     dc.l    _IT9b
  2482. _IT9b:
  2483.     dc.b    2,0,RP_JAM1,0
  2484.     dc.w    14,3
  2485.     dc.l    topaz80
  2486.     dc.l    _ITT9
  2487.     dc.l    NULL
  2488. _ITT9:
  2489.     dc.b    'ReBoot',0
  2490.     
  2491.     even
  2492.  
  2493. ;===========================
  2494. ;= Gadgets for preferences =
  2495. ;===========================
  2496.  
  2497. Gadget10:
  2498.     dc.l    Gadget11
  2499.     dc.w    220,30
  2500.     dc.w    15,9
  2501. tog1    dc.w    GADGHCOMP+SELECTED
  2502.     dc.w    RELVERIFY+TOGGLESELECT
  2503.     dc.w    BOOLGADGET
  2504.     dc.l    RenderBorder4
  2505.     dc.l    NULL
  2506.     dc.l    NULL
  2507.     dc.l    NULL
  2508.     dc.l    NULL
  2509.     dc.w    NOCARE
  2510.     dc.l    NULL
  2511.     
  2512.     even
  2513.  
  2514. Gadget11:
  2515.     dc.l    Gadget12
  2516.     dc.w    220,50
  2517.     dc.w    15,9
  2518. tog2    dc.w    GADGHCOMP+SELECTED
  2519.     dc.w    RELVERIFY+TOGGLESELECT
  2520.     dc.w    BOOLGADGET
  2521.     dc.l    RenderBorder4
  2522.     dc.l    NULL
  2523.     dc.l    NULL
  2524.     dc.l    NULL
  2525.     dc.l    NULL
  2526.     dc.w    MOUSEACC
  2527.     dc.l    NULL
  2528.  
  2529.     even
  2530.  
  2531. Gadget12:
  2532.     dc.l    Gadget13
  2533.     dc.w    220,70
  2534.     dc.w    15,9
  2535. tog3    dc.w    GADGHCOMP+SELECTED
  2536.     dc.w    RELVERIFY+TOGGLESELECT
  2537.     dc.w    BOOLGADGET
  2538.     dc.l    RenderBorder4
  2539.     dc.l    NULL
  2540.     dc.l    NULL
  2541.     dc.l    NULL
  2542.     dc.l    NULL
  2543.     dc.w    FUNCTIONKEYS
  2544.     dc.l    NULL
  2545.  
  2546. Gadget13:
  2547.     dc.l    Gadget14
  2548.     dc.w    30,120
  2549.     dc.w    80,15
  2550.     dc.w    GADGHIMAGE
  2551.     dc.w    RELVERIFY
  2552.     dc.w    BOOLGADGET
  2553.     dc.l    Border1
  2554.     dc.l    RenderBorder1
  2555.     dc.l    PText13
  2556.     dc.l    NULL
  2557.     dc.l    NULL
  2558.     dc.w    CANCEL
  2559.     dc.l    NULL
  2560. PText13:
  2561.     dc.b    1,0,RP_JAM2,0
  2562.     dc.w    15,4
  2563.     dc.l    topaz80
  2564.     dc.l    PTextText13
  2565.     dc.l    PText13b
  2566. PText13b:
  2567.     dc.b    2,0,RP_JAM1,0
  2568.     dc.w    14,3
  2569.     dc.l    topaz80
  2570.     dc.l    PTextText13
  2571.     dc.l    NULL
  2572. PTextText13:
  2573.     dc.b    'Cancel',0
  2574.     
  2575.     even
  2576.  
  2577. Gadget14:
  2578.     dc.l    Gadget15
  2579.     dc.w    130,120
  2580.     dc.w    80,15
  2581.     dc.w    GADGHIMAGE
  2582.     dc.w    RELVERIFY
  2583.     dc.w    BOOLGADGET
  2584.     dc.l    Border1
  2585.     dc.l    RenderBorder1
  2586.     dc.l    PText14
  2587.     dc.l    NULL
  2588.     dc.l    NULL
  2589.     dc.w    USE
  2590.     dc.l    NULL
  2591. PText14:
  2592.     dc.b    1,0,RP_JAM2,0
  2593.     dc.w    26,4
  2594.     dc.l    topaz80
  2595.     dc.l    PTextText14
  2596.     dc.l    PText14b
  2597. PText14b:
  2598.     dc.b    2,0,RP_JAM1,0
  2599.     dc.w    25,3
  2600.     dc.l    topaz80
  2601.     dc.l    PTextText14
  2602.     dc.l    NULL
  2603. PTextText14:
  2604.     dc.b    'Use',0
  2605.     
  2606.     even
  2607.  
  2608. Gadget15:
  2609.     dc.l    NULL
  2610.     dc.w    230,120
  2611.     dc.w    80,15
  2612.     dc.w    GADGHIMAGE
  2613.     dc.w    RELVERIFY
  2614.     dc.w    BOOLGADGET
  2615.     dc.l    Border1
  2616.     dc.l    RenderBorder1
  2617.     dc.l    PText15
  2618.     dc.l    NULL
  2619.     dc.l    NULL
  2620.     dc.w    SAVE
  2621.     dc.l    NULL
  2622. PText15:
  2623.     dc.b    1,0,RP_JAM2,0
  2624.     dc.w    22,4
  2625.     dc.l    topaz80
  2626.     dc.l    PTextText15
  2627.     dc.l    PText15b
  2628. PText15b:
  2629.     dc.b    2,0,RP_JAM1,0
  2630.     dc.w    21,3
  2631.     dc.l    topaz80
  2632.     dc.l    PTextText15
  2633.     dc.l    NULL
  2634. PTextText15:
  2635.     dc.b    'Save',0
  2636.     
  2637.     even
  2638.  
  2639. ;======== Tekst structures for viewmemory ============
  2640.  
  2641. IText8:
  2642.     dc.b    1,0,RP_JAM2,0
  2643.     dc.w    11,26
  2644.     dc.l    topaz80
  2645. MTE8    dc.l    NULL
  2646.     dc.l    IText8b
  2647. IText8b:
  2648.     dc.b    2,0,RP_JAM1,0
  2649.     dc.w    10,25
  2650.     dc.l    topaz80
  2651. MTE8b    dc.l    NULL
  2652.     dc.l    IText9
  2653.  
  2654. IText9:
  2655.     dc.b    1,0,RP_JAM2,0
  2656.     dc.w    11,36
  2657.     dc.l    topaz80
  2658. MTE9    dc.l    NULL
  2659.     dc.l    IText9b
  2660. IText9b:
  2661.     dc.b    2,0,RP_JAM1,0
  2662.     dc.w    10,35
  2663.     dc.l    topaz80
  2664. MTE9b    dc.l    NULL
  2665.     dc.l    IText10
  2666.  
  2667. IText10:
  2668.     dc.b    1,0,RP_JAM2,0
  2669.     dc.w    11,46
  2670.     dc.l    topaz80
  2671. MTE10    dc.l    NULL
  2672.     dc.l    IText10b
  2673. IText10b:
  2674.     dc.b    2,0,RP_JAM1,0
  2675.     dc.w    10,45
  2676.     dc.l    topaz80
  2677. MTE10b    dc.l    NULL
  2678.     dc.l    IText11
  2679.  
  2680. IText11:
  2681.     dc.b    1,0,RP_JAM2,0
  2682.     dc.w    11,56
  2683.     dc.l    topaz80
  2684. MTE11    dc.l    NULL
  2685.     dc.l    IText11b
  2686. IText11b:
  2687.     dc.b    2,0,RP_JAM1,0
  2688.     dc.w    10,55
  2689.     dc.l    topaz80
  2690. MTE11b    dc.l    NULL
  2691.     dc.l    IText12
  2692.  
  2693. IText12:
  2694.     dc.b    1,0,RP_JAM2,0
  2695.     dc.w    11,66
  2696.     dc.l    topaz80
  2697. MTE12    dc.l    NULL
  2698.     dc.l    IText12b
  2699. IText12b:
  2700.     dc.b    2,0,RP_JAM1,0
  2701.     dc.w    10,65
  2702.     dc.l    topaz80
  2703. MTE12b    dc.l    NULL
  2704.     dc.l    IText13
  2705.  
  2706. IText13:
  2707.     dc.b    1,0,RP_JAM2,0
  2708.     dc.w    11,81
  2709.     dc.l    topaz80
  2710. MTE13    dc.l    NULL
  2711.     dc.l    IText13b
  2712. IText13b:
  2713.     dc.b    2,0,RP_JAM1,0
  2714.     dc.w    10,80
  2715.     dc.l    topaz80
  2716. MTE13b    dc.l    NULL
  2717.     dc.l    NULL
  2718. IText14:
  2719.     dc.b    1,0,RP_JAM2,0
  2720.     dc.w    10
  2721. y1    dc.w    0
  2722.     dc.l    topaz80
  2723. MTE14    dc.l    dummy
  2724.     dc.l    IText14b
  2725. IText14b:
  2726.     dc.b    2,0,RP_JAM1,0
  2727.     dc.w    9
  2728. y2    dc.w    0
  2729.     dc.l    topaz80
  2730. MTE14b    dc.l    dummy
  2731.     dc.l    NULL
  2732.  
  2733. ;== Help strings =====================================
  2734.  
  2735. Text15:
  2736.     dc.b    1,0,RP_JAM2,0
  2737.     dc.w    11,21
  2738.     dc.l    topaz80
  2739.     dc.l    T15
  2740.     dc.l    Text15b
  2741. Text15b:
  2742.     dc.b    2,0,RP_JAM1,0
  2743.     dc.w    10,20
  2744.     dc.l    topaz80
  2745.     dc.l    T15
  2746.     dc.l    Text16
  2747. T15    dc.b    'This program is programmed by EA van Breemen',0
  2748.     even
  2749. Text16:
  2750.     dc.b    1,0,RP_JAM2,0
  2751.     dc.w    11,31
  2752.     dc.l    topaz80
  2753.     dc.l    T16
  2754.     dc.l    Text16b
  2755. Text16b:
  2756.     dc.b    2,0,RP_JAM1,0
  2757.     dc.w    10,30
  2758.     dc.l    topaz80
  2759.     dc.l    T16
  2760.     dc.l    Text17
  2761. T16    dc.b    'Copyright by Orega Holland',0
  2762.     even
  2763. Text17:
  2764.     dc.b    1,0,RP_JAM2,0
  2765.     dc.w    11,41
  2766.     dc.l    topaz80
  2767.     dc.l    T17
  2768.     dc.l    Text17b
  2769. Text17b:
  2770.     dc.b    2,0,RP_JAM1,0
  2771.     dc.w    10,40
  2772.     dc.l    topaz80
  2773.     dc.l    T17
  2774.     dc.l    Text18
  2775. T17    dc.b    169,'1989-1992. Any commercially based reproducing',0
  2776.     even
  2777. Text18:
  2778.     dc.b    1,0,RP_JAM2,0
  2779.     dc.w    11,51
  2780.     dc.l    topaz80
  2781.     dc.l    T18
  2782.     dc.l    Text18b
  2783. Text18b:
  2784.     dc.b    2,0,RP_JAM1,0
  2785.     dc.w    10,50
  2786.     dc.l    topaz80
  2787.     dc.l    T18
  2788.     dc.l    Text19
  2789. T18    dc.b    'by any means of this shareware product is illegal.',0
  2790.     even
  2791. Text19:
  2792.     dc.b    1,0,RP_JAM2,0
  2793.     dc.w    11,61
  2794.     dc.l    topaz80
  2795.     dc.l    T19
  2796.     dc.l    Text19b
  2797. Text19b:
  2798.     dc.b    2,0,RP_JAM1,0
  2799.     dc.w    10,60
  2800.     dc.l    topaz80
  2801.     dc.l    T19
  2802.     dc.l    Text20
  2803. T19    dc.b    'If you find this program usefull please send $10',0
  2804.     even
  2805. Text20:
  2806.     dc.b    1,0,RP_JAM2,0
  2807.     dc.w    11,71
  2808.     dc.l    topaz80
  2809.     dc.l    T20
  2810.     dc.l    Text20b
  2811. Text20b:
  2812.     dc.b    2,0,RP_JAM1,0
  2813.     dc.w    10,70
  2814.     dc.l    topaz80
  2815.     dc.l    T20
  2816.     dc.l    Text21
  2817. T20    dc.b    'to: EA van Breemen, Berliozplein 15, 2651 VG',0
  2818.     even
  2819. Text21:
  2820.     dc.b    1,0,RP_JAM2,0
  2821.     dc.w    11,81
  2822.     dc.l    topaz80
  2823.     dc.l    T21
  2824.     dc.l    Text21b
  2825. Text21b:
  2826.     dc.b    2,0,RP_JAM1,0
  2827.     dc.w    10,80
  2828.     dc.l    topaz80
  2829.     dc.l    T21
  2830.     dc.l    Text22
  2831. T21    dc.b    'Berkel en Rodenrijs,  Holland.',0
  2832.     even
  2833. Text22:
  2834.     dc.b    1,0,RP_JAM2,0
  2835.     dc.w    11,101
  2836.     dc.l    topaz80
  2837.     dc.l    T22
  2838.     dc.l    Text22b
  2839. Text22b:
  2840.     dc.b    2,0,RP_JAM1,0
  2841.     dc.w    10,100
  2842.     dc.l    topaz80
  2843.     dc.l    T22
  2844.     dc.l    Text23
  2845. T22    dc.b    'Help:   Ctrl-F1   ..... NewShell',0
  2846.     even
  2847. Text23:
  2848.     dc.b    1,0,RP_JAM2,0
  2849.     dc.w    11,111
  2850.     dc.l    topaz80
  2851.     dc.l    T23
  2852.     dc.l    Text23b
  2853. Text23b:
  2854.     dc.b    2,0,RP_JAM1,0
  2855.     dc.w    10,110
  2856.     dc.l    topaz80
  2857.     dc.l    T23
  2858.     dc.l    NULL
  2859. T23    dc.b    '        Ctrl-HELP ..... BigBrother',0
  2860.     even
  2861.  
  2862. Text24:
  2863.     dc.b    1,0,RP_JAM2,0
  2864.     dc.w    31,31
  2865.     dc.l    topaz80
  2866.     dc.l    T24
  2867.     dc.l    Text24b
  2868. Text24b:
  2869.     dc.b    2,0,RP_JAM1,0
  2870.     dc.w    30,30
  2871.     dc.l    topaz80
  2872.     dc.l    T24
  2873.     dc.l    Text25
  2874. T24    dc.b    'NoCare patch installed:',0
  2875.     even
  2876.  
  2877. Text25:
  2878.     dc.b    1,0,RP_JAM2,0
  2879.     dc.w    31,51
  2880.     dc.l    topaz80
  2881.     dc.l    T25
  2882.     dc.l    Text25b
  2883. Text25b:
  2884.     dc.b    2,0,RP_JAM1,0
  2885.     dc.w    30,50
  2886.     dc.l    topaz80
  2887.     dc.l    T25
  2888.     dc.l    Text26
  2889. T25    dc.b    'Mouse accelerator:',0
  2890.     even
  2891. Text26:
  2892.     dc.b    1,0,RP_JAM2,0
  2893.     dc.w    31,71
  2894.     dc.l    topaz80
  2895.     dc.l    T26
  2896.     dc.l    Text26b
  2897. Text26b:
  2898.     dc.b    2,0,RP_JAM1,0
  2899.     dc.w    30,70
  2900.     dc.l    topaz80
  2901.     dc.l    T26
  2902.     dc.l    NULL
  2903. T26    dc.b    'Function keys enabled:',0
  2904.     even
  2905.  
  2906.  
  2907. RenderBorder4:
  2908.     dc.w    -1,-1
  2909.     dc.b    1,0,RP_JAM2
  2910.     dc.b    3
  2911.     dc.l    BorderVectors4
  2912.     dc.l    RenderBorder4a
  2913. RenderBorder4a:
  2914.     dc.w    -1,-1
  2915.     dc.b    2,0,RP_JAM2
  2916.     dc.b    3
  2917.     dc.l    BorderVectors4a
  2918.     dc.l    NULL
  2919.  
  2920. BorderVectors4:
  2921.     dc.w    0,10
  2922.     dc.w    0,0
  2923.     dc.w    17,0
  2924. BorderVectors4a:
  2925.     dc.w    17,0
  2926.     dc.w    17,10
  2927.     dc.w    0,10    
  2928.  
  2929.  
  2930.  
  2931.  
  2932. ;=====================================================
  2933.  
  2934. expert    dc.b    0,1,2,2,3,4,5,6,3,4,7
  2935.     dc.b       7,3,4,7,7,8,8,0,1,8,8
  2936.     dc.b    5,5,8,8,7,7,8,8,7,7
  2937.  
  2938.     even
  2939.  
  2940. convtable    dc.b    '0123456789abcdef',0
  2941.     even
  2942.  
  2943. message    dc.b    'This system has been modified.',0
  2944. L0    dc.b    'Memory is clean.',0
  2945. L1    dc.b    'Sca virus.',0
  2946. L2    dc.b    'Unknown virus or not mounted rad.',0
  2947. L3    dc.b    'Non reset virus.',0
  2948. L4    dc.b    'Saddam like virus.',0
  2949. L5    dc.b    'Dasa virus.',0
  2950. L6    dc.b    'Dasa like virus.',0
  2951. L7    dc.b    'ByteBandit or Lamer virus.',0
  2952. L8    dc.b    'Unknown system configuration???',0
  2953. L9    dc.b    'System has not been modified. ',0
  2954. L10    dc.b    '                                 ',0
  2955.  
  2956.     even
  2957.  
  2958. TaskName    dc.b    'RAD',0
  2959.     even
  2960. devicename    dc.b    'trackdisk.device',0
  2961.     even
  2962. MyPortName    dc.b    'BigBrother Port',0
  2963.     even
  2964. errormessage    dc.b    'BootBlock Read/Write Error.',0
  2965.     even
  2966. found_rad    dc.b    'RadTask has been found.',0
  2967.     even
  2968. no_found_rad    dc.b    'RadTask has not been found.',0
  2969.     even
  2970. Alertstring    dc.w    170
  2971.         dc.b    15
  2972.         dc.b    '! ! ! ! !  W A R N I N G ! ! ! ! ! ',0
  2973.         dc.b    1
  2974.         dc.w    176
  2975.         dc.b    27
  2976.         dc.b    'Are you sure to clear the memory?',0
  2977.         dc.b    1
  2978.         dc.w    10
  2979.         dc.b    39
  2980.         dc.b    'Press <LEFT MOUSE BUTTON> for OK  ----  Press <RIGHT MOUSE BUTTON> for CANCEL',0
  2981.         dc.b    0
  2982.     even
  2983. Alertstring2    dc.w    170
  2984.         dc.b    15
  2985.         dc.b    '! ! ! ! !  W A R N I N G ! ! ! ! ! ',0
  2986.         dc.b    1
  2987.         dc.w    176
  2988.         dc.b    27
  2989.         dc.b    'Are you sure you want to Reboot? ',0
  2990.         dc.b    1
  2991.         dc.w    10
  2992.         dc.b    39
  2993.         dc.b    'Press <LEFT MOUSE BUTTON> for OK  ----  Press <RIGHT MOUSE BUTTON> for CANCEL',0
  2994.         dc.b    0
  2995.     even
  2996.  
  2997. Alertstring3    dc.w    170
  2998.         dc.b    15
  2999.         dc.b    '! ! ! ! !  W A R N I N G ! ! ! ! ! ',0
  3000.         dc.b    1
  3001.         dc.w    176
  3002.         dc.b    27
  3003.         dc.b    'Are you sure you want to quit ?  ',0
  3004.         dc.b    1
  3005.         dc.w    10
  3006.         dc.b    39
  3007.         dc.b    'Press <LEFT MOUSE BUTTON> for OK  ----  Press <RIGHT MOUSE BUTTON> for CANCEL',0
  3008.         dc.b    0
  3009.     even
  3010.  
  3011.  
  3012. ;================
  3013. ;= Library data =
  3014. ;================
  3015.  
  3016. DosName    dc.b    'dos.library',0
  3017.     cnop 0,2
  3018. IntuitionName     dc.b 'intuition.library',0
  3019.     cnop 0,2
  3020. GraphicsName     dc.b 'graphics.library',0
  3021.     cnop 0,2
  3022. coldcapture    dc.b    'ColdCapture - Offset   42 :$',0
  3023. coolcapture    dc.b    'CoolCapture - Offset   46 :$',0
  3024. kickmemptr    dc.b    'KickMemPtr  - Offset  546 :$',0
  3025. kicktagptr    dc.b    'KickTagPtr  - Offset  550 :$',0
  3026. doio_vector    dc.b    'DoIO Vector - Offset -454 :$',0
  3027.  
  3028. number        dc.b    '00000000',0
  3029.     even
  3030.  
  3031. BIG_NAME    dc.b    'BigBrother Process',0
  3032. CHECK_NAME    dc.b    'Check Task',0
  3033.     even
  3034. NIL_NAME    dc.b    'NIL:',0
  3035.     even
  3036.  
  3037. acc    dc.w    3
  3038.  
  3039.  
  3040. script2        dc.b    'Execute s:F2',0
  3041. script3        dc.b    'Execute s:F3',0
  3042. script4        dc.b    'Execute s:F4',0
  3043. script5        dc.b    'Execute s:F5',0
  3044. script6        dc.b    'Execute s:F6',0
  3045. script7        dc.b    'Execute s:F7',0
  3046. script8        dc.b    'Execute s:F8',0
  3047. script9        dc.b    'Execute s:F9',0
  3048. script10    dc.b    'Execute s:F10',0
  3049.  
  3050.  
  3051.  
  3052. ;=====================
  3053. ;= Input Device data =
  3054. ;=====================
  3055.  
  3056. InputDeviceName    dc.b    'input.device',0
  3057.     even
  3058.  
  3059.  
  3060.  
  3061. df0    dc.l    'DF0:'
  3062. df1    dc.l    'DF1:'
  3063. df2    dc.l    'DF2:'
  3064. df3    dc.l    'DF3:'
  3065.  
  3066.     dc.b    '    DoIO vector:'
  3067.     even
  3068. DoIOVector    dc.l    $fc06dc        ; DoIO Vector for V1.2
  3069. TrackDiskIO    dc.l    $0
  3070. patchstatus    dc.b    1
  3071.     even
  3072.  
  3073. commandstring    dc.b    'newshell "con:0/0/639/100/Big Brother V3.12"',0
  3074.     cnop 0,2
  3075.  
  3076.     even
  3077.     section "Main",bss
  3078.     
  3079.  
  3080. DOSBase            ds.l    1
  3081. GfxBase            ds.l    1
  3082. IntuitionBase        ds.l    1
  3083. window            ds.l    1
  3084. window2            ds.l    1
  3085. window3            ds.l    1
  3086. oldopenwindow        ds.l    1
  3087. rp            ds.l    1
  3088. rp2            ds.l    1
  3089. buffer            ds.l    1
  3090. keyfound        ds.w    1
  3091. commando        ds.w    1
  3092. Mode            ds.b    1
  3093. signal            ds.b    1
  3094. drive            ds.b    1
  3095. io_error        ds.b    1
  3096.     even
  3097. diskio            ds.l    20
  3098. readreply        ds.l    8
  3099. memorymask        ds.l    1
  3100. filehandle        ds.l    1
  3101. lock            ds.l    1
  3102. virusmask        ds.l    1
  3103. keymask            ds.l    1
  3104. bigtask            ds.l    1
  3105. InputDevPort        ds.l    1
  3106.  
  3107. InputRequestBlock    ds.b    $30
  3108.     even
  3109. HandlerStuff        ds.b    $16
  3110.     even
  3111. dummy            ds.b    70
  3112.     even
  3113. userport    ds.l    1
  3114. myseg        ds.l    1
  3115. pcb_Input    ds.l    1
  3116. pcb_Output    ds.l    1
  3117.  
  3118. tempstatus    ds.b    1
  3119. status        ds.b    1
  3120.     even
  3121. stack        ds.l    256
  3122. checktask    ds.l    1
  3123.  
  3124.  
  3125. ;=========================
  3126. ;= The end of the source =
  3127. ;=========================    
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.     end
  3134.  
  3135.  
  3136.  
  3137.  
  3138.